/* ===== Registration Page — Custom Styles ===== */

:root {
    --green-dark: #1a3a2a;
    --green-mid: #2a5a3e;
    --green-light: #3d7a57;
    --gold: #c9a84c;
    --gold-light: #e8c97a;
    --gold-pale: #f7f0dc;
    --cream: #f8f4ed;
    --text-main: #1a2e22;
    --text-muted: #5a7262;
    --white: #ffffff;
}

/* ── En-tête de page (Hero) ── */
.page-header {
    position: relative;
    background-image: url('../images/silhouette-dome-mosques-on-twilight-with-crescent-moon-colorful-night-sky-background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 120px 20px;
    text-align: center;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: transparent;
    background-image: linear-gradient(180deg, #0ba39e 0%, #aa8730 100%);
    opacity: 0.5;
    transition: background 0.3s, border-radius 0.3s, opacity 0.3s;
    z-index: 1;
}

.page-header .container {
    position: relative;
    z-index: 2;
}

.page-header .breadcrumb {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: #d7e2e8;
    font-size: 14px;
    margin-bottom: 12px;
}

.page-header .separator {
    color: var(--gold-light);
    font-size: 16px;
    margin-top: -2px;
}

.page-header h1 {
       color: #fff;
    font-size: 65px;
    font-weight: 750;
    margin: 19px;
}


/* ── Form Section ── */
.registration-main {
    padding: 60px 0;
    background-color: #fff;
}

.registration-main__inner {
    max-width: 1000px;
    /* Increased to give more space */
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.registration-card {
    padding: 50px 60px;
    /* Slightly increased padding */
    margin-top: 110px;
    /* Increased space for the title above */
    position: relative;
    z-index: 1;
}

.registration-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgb(247, 247, 247);
    border: 2px solid #137976;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .03);
    z-index: -1;
    opacity: 0;
}

.registration-card.is-visible::before {
    animation: fadeUpForm 1.5s ease-out forwards;
}

.registration-form {
    opacity: 0;
}

.registration-card.is-visible .registration-form {
    animation: fadeUpForm 1.5s ease-out 0.15s forwards;
}

.registration-card-title {
    position: absolute;
    top: -85px;
    /* Adjusted to increase the space between text and form */
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0;
    /* Hide the old "إنشاء حساب جديد" text */
    margin: 0;
}

.registration-card-title::after {
    content: "التسجيل في الأكاديمية";
    /* Inject the requested text */
    font-size: 45px;
    font-weight: 700;
    color: #137976;
}

.form-fields {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px 15px;
    direction: rtl;
    max-width: 480px;
    /* Narrowed slightly for more side space */
    margin: 0 auto;
    /* Center the form fields inside the wide card */
}

.form-field {
    display: flex;
    flex-direction: column;
    grid-column: 1 / -1;
}

.form-fields>.form-field:nth-child(4) {
    grid-column: 1 / 2;
    /* Right */
}

.form-fields>.form-field:nth-child(5) {
    grid-column: 2 / 3;
    /* Left */
}

.form-field--full {
    grid-column: 1 / -1;
}

@media (max-width: 640px) {
    .form-fields {
        grid-template-columns: 1.2fr 2fr;
    }
}

.form-field__label {
    font-size: 14px;
    font-weight: 600;
    color: #0f2b3d;
    margin-bottom: 8px;
}

.form-field__required {
    display: none;
}

.form-field__input {
    border: 1px solid var(--gold);
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease;
    height: 40px;
    width: 100%;
    box-sizing: border-box;
}

.form-field__select {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 0 12px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease;
    height: 40px;
    width: 100%;
    box-sizing: border-box;
}

.form-field__input:focus,
.form-field__select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.2);
}

.form-field__input--error,
.form-field__select--error {
    border-color: #d64545;
}

.form-field__error {
    margin-top: 6px;
    font-size: 13px;
    color: #d64545;
}

.form-submit {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #A78438;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 40px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s ease;
    width: 250px;
}

.btn-submit:hover {
    background: #8a6d2c;
}

/* Password Toggle Eye Icon */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-field__input {
    width: 100%;
    padding-left: 45px;
    /* Leave breathing room on the left side for the icon */
}

.password-toggle-btn {
    position: absolute;
    left: 15px;
    /* Anchor to the left side (RTL layout) */
    background: none !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    box-shadow: none !important;
    transition: color 0.2s ease;
}

.password-toggle-btn:hover {
    color: #555;
    background: none !important;
}

@keyframes fadeUpForm {
    0% {
        opacity: 0;
        transform: translateY(100px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   Mobile Responsiveness
========================================== */
@media (max-width: 767px) {
    .registration-card {
        padding: 40px 20px;
    }
    
    .registration-card-title::after {
        font-size: 32px;
    }

    .form-field__input, .form-field__select {
        box-sizing: border-box;
    }
}