/* ========== RESET & BASE ========== */
* {
    box-sizing: border-box;
    margin: 0;
    direction: rtl;
}
body {
    font-family: "Hacen Tehran", sans-serif, Arial, Tahoma;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    text-align: right;
    background-color: #f8f9fa;
}

/* ========== LAYOUT & CONTAINER ========== */
.top-image img {
    position: absolute;
    top: -25rem;
    left: 50%;
    transform: translateX(-49.8%);
    width: 100vw !important;
    z-index: -1;
}
#forms .container,
section#forms .container {
    position: relative;
    background: white;
    border-radius: 30px;
    padding: 30px 35px;
    box-shadow: 0 8px 20px rgb(0 0 0 / 0.15);
    z-index: 1;
    width: 100%;
    max-width: 1000px;
}

/* ========== FORMS & HEADERS ========== */
#forms .container img,
section#forms .container img {
    width: 140px;
    height: 140px;
    padding: 10px;
    background-color: white;
    border-radius: 50%;
    object-fit: contain;
    margin-bottom: 20px;
    position: relative;
    bottom: 90px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.head h1 {
    font-size: 1.5rem;
    color: #343a40;
    font-weight: bold;
    margin-bottom: 0.75rem;
    margin-top: -70px;
    text-align: center;
}

/* ========== BUTTONS ========== */
button[type="submit"],
.btn-login,
.custom-submit-btn,
.btn-upload-image {
    background-color: #159f97 !important;
    border-color: #159f97 !important;
    color: white !important;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 50px !important;
    padding: 0.85rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px #2196f344;
}
.btn-login:hover,
.custom-submit-btn:hover,
.btn-upload-image:hover {
    background-color: #117a74 !important;
    border-color: #117a74 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(21, 159, 151, 0.3);
}
.btn-upload-image {
    width: auto;
    display: inline-block;
    font-size: 1rem;
    font-weight: 500;
    padding: 8px 24px;
    margin-top: 0 !important;
    margin-bottom: 10px;
}

/* ========== INPUTS & LABELS ========== */
label,
.form-label {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: #495057;
    font-weight: 500;
}
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="date"],
select,
.form-control {
    padding: 0.85rem 1rem;
    font-size: 1rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s ease;
    color: #495057;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
select:focus,
.form-control:focus {
    border-color: #159f97;
    box-shadow: 0 0 0 3px rgba(21, 159, 151, 0.2);
}

/* ========== MEDIA QUERIES ========== */
@media (min-width: 992px) {
    #forms .container,
    section#forms .container {
        width: 90vw;
        padding: 20px 10px;
        margin-top: 80px;
    }
    .footer-bg-wrapper {
        bottom: -150px;
    }
}
@media (max-width: 992px) {
    #forms .container,
    section#forms .container {
        width: 90vw;
        padding: 20px 10px;
        margin-top: 80px;
    }
    .footer-bg-wrapper {
        bottom: -150px;
    }
}
@media (max-width: 768px) {
    #forms .container,
    section#forms .container {
        width: 91vw;
        padding: 16px 2vw;
        margin-top: 40px;
    }
    .row {
        flex-direction: column;
        gap: 10px;
    }
    .row > div {
        width: 100%;
        margin-bottom: 10px;
    }
    .btn-upload-image {
        font-size: 0.95rem;
        padding: 7px 16px;
    }
    .profile-image-preview img {
        width: 90px !important;
        height: 90px !important;
    }
    #forms .container img,
    section#forms .container img {
        width: 110px;
        height: 110px;
        bottom: 65px;
    }
    .head h1 {
        font-size: 1.3rem;
    }
    .form-control,
    .btn-login,
    .custom-submit-btn {
        font-size: 0.95rem;
    }
    .input-group {
        flex-wrap: nowrap !important;
        display: flex;
        align-items: stretch;
    }
    .input-group-text {
        min-width: 38px;
        font-size: 1rem;
        padding: 0 8px;
        height: auto;
        border-radius: 8px 0 0 8px;
        align-items: center;
        justify-content: center;
    }
    .head .register, .head .login {
        font-size: 0.89rem;
        gap: 0.4rem;
        margin-bottom: 1rem;
    }
    .btn-toggle {
        font-size: 0.95rem;
        padding: 5px 14px;
    }
}
@media (max-width: 576px) {
    #forms .container,
    section#forms .container {
        width: 95vw;
        padding: 10px 1vw;
        margin-top: 20px;
    }
    .footer-bg-wrapper {
        bottom: -100px;
        padding: 0 10px;
    }
    .footer-bg {
        width: 110%;
    }
    #forms .container img,
    section#forms .container img {
        width: 90px;
        height: 90px;
        bottom: 55px;
    }
    .head h1 {
        margin-top: -60px;
        font-size: 1.2rem;
    }
    .btn-toggle-group {
        gap: 0.5rem;
    }
    .btn-toggle {
        font-size: 0.9rem;
        padding: 6px 15px;
    }
    .btn-back-modern,
    .btn-reset-modern,
    .custom-submit-btn,
    .btn-login,
    button[type="submit"] {
        font-size: 0.8rem !important;
        height: 34px !important;
        min-width: 110px !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        white-space: nowrap !important;
    }
    .head .register, .head .login {
        font-size: 0.8rem;
        gap: 0.2rem;
        margin-bottom: 0.7rem;
    }
    .btn-toggle {
        font-size: 0.85rem;
        padding: 4px 8px;
        min-width: 70px;
    }
}
@media (max-width: 481px) {
    #forms .container,
    section#forms .container {
        width: 85vw !important;
        padding: 5px 1vw;
        margin-top: 30px;
    }
    .btn-upload-image {
        font-size: 0.9rem;
        padding: 6px 10px;
    }
    .profile-image-preview img {
        width: 70px !important;
        height: 70px !important;
    }
    .head h1 {
        font-size: 1.1rem;
    }
    .form-control {
        font-size: 10px;
        padding: 8px 10px;
    }
    button[type="submit"],
    .btn-login,
    .custom-submit-btn {
        font-size: 12px;
        padding: 8px 0;
    }
    input,
    select,
    textarea,
    .form-control {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        height: 44px !important;
        min-height: 44px !important;
        line-height: 1.4 !important;
        padding-top: 8px !important;
        padding-bottom: 8px !important;
        font-size: 15px !important;
    }
    .icheck-primary input[type="checkbox"] {
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        min-height: 18px !important;
        max-width: 18px !important;
        max-height: 18px !important;
        margin-top: 2px !important;
    }
    .icheck-primary label {
        font-size: 0.95rem !important;
        line-height: 1.7 !important;
        margin-bottom: 0 !important;
        padding-right: 5px !important;
        white-space: nowrap !important;
    }
}
@media (max-width: 400px) {
    .btn-back-modern,
    .btn-reset-modern,
    .custom-submit-btn,
    .btn-login,
    button[type="submit"] {
        font-size: 0.75rem !important;
        height: 32px !important;
        min-height: 32px !important;
        width: 100% !important;
        min-width: unset !important;
        padding-left: 0.2rem !important;
        padding-right: 0.2rem !important;
        white-space: normal !important;
        border-radius: 50px !important;
    }
    .container {
        width: 98vw !important;
        padding: 4px !important;
        border-radius: 18px !important;
    }
    .container h1,
    .container .head h1 {
        font-size: 1rem !important;
    }
}
@media (max-width: 882px) and (min-width: 577px) {
    .btn-back-modern,
    .btn-reset-modern,
    .custom-submit-btn,
    .btn-login,
    button[type="submit"] {
        font-size: 0.92rem !important;
        height: 38px !important;
        min-width: 120px !important;
        padding-left: 0.7rem !important;
        padding-right: 0.7rem !important;
        white-space: nowrap !important;
    }
}

/* ========== Footer ========== */
.footer-bg-wrapper {
    position: fixed;
    position: absolute;
    bottom: 0;
    /* top: -550px; */
    /* left: 50%; */
    /* transform: translateX(-49.8%); */
    width: 100vw !important;
    /* z-index: -1; */
}
.footer-bg {
    width: 100vw !important;
    display: block;
    object-fit: cover;
    user-select: none;
    position: relative;
    bottom: 0;
}

.btn-back-modern,
.btn-reset-modern {
    background: linear-gradient(90deg, #159f97 0%, #43e794 100%);
    color: #fff !important;
    border: none;
    border-radius: 50px;
    padding: 0.7rem 1.7rem 0.7rem 1.2rem;
    font-size: 1.08rem;
    font-weight: bold;
    box-shadow: 0 2px 12px rgba(21, 159, 151, 0.13);
    transition: background 0.3s, box-shadow 0.3s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    outline: none;
    min-width: 170px;
    justify-content: center;
    text-decoration: none !important;
}
.btn-back-modern .back-arrow,
.btn-reset-modern .reset-arrow {
    display: flex;
    align-items: center;
    transition: transform 0.25s cubic-bezier(0.4, 2, 0.6, 1);
}
.btn-back-modern:hover,
.btn-reset-modern:hover {
    background: linear-gradient(90deg, #43e794 0%, #159f97 100%);
    box-shadow: 0 4px 18px rgba(21, 159, 151, 0.22);
    transform: translateY(-2px) scale(1.03);
    color: #fff !important;
    text-decoration: none !important;
}
.btn-back-modern:hover .back-arrow {
    transform: translateX(-7px) scale(1.15);
}
.btn-reset-modern:hover .reset-arrow {
    transform: translateX(7px) scale(1.15);
}
.back-text-shadow,
.reset-text-shadow {
    text-shadow: 0 3px 8px rgba(21, 159, 151, 0.18), 0 1px 0 #fff;
    text-decoration: none !important;
}

.input-group-text {
    height: 100%;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: #f8f9fa;
    border: 1px solid #ced4da;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.input-group-text:hover {
    background: #e9ecef;
    color: #159f97;
}

/* ========== TOGGLE BUTTONS (طالب/معلم) ========== */
.btn-toggle-group {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}
.btn-toggle {
    cursor: pointer;
    border-radius: 30px;
    padding: 6px 20px;
    font-size: 1rem;
    border: none;
    color: #fff;
    background-color: #159f97;
    transition: background-color 0.3s;
    user-select: none;
    font-weight: 500;
    min-width: 90px;
    outline: none;
    box-shadow: 0 2px 8px #2196f344;
}
.btn-toggle.inactive {
    background-color: #d0d0d0;
    color: #666;
    box-shadow: none;
}
.btn-toggle:focus {
    outline: 2px solid #159f97;
}

/* ========== REGISTER/LOGIN LINKS ========== */
.head .register, .head .login {
    font-size: 0.97rem;
    display: flex;
    justify-content: center;
    gap: 0.7rem;
    margin-bottom: 1.2rem;
    color: #555;
    flex-wrap: wrap;
}
.head .register a, .head .login a, .text-end a, .ufuq-link {
    color: #159f97;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s, text-decoration 0.2s;
}
.head .register a:hover, .head .login a:hover, .text-end a:hover, .ufuq-link:hover {
    text-decoration: underline;
    color: #117a74;
}

/* ========== UTILITIES & FUTURE STYLES ========== */
/* أضف هنا أي ستايلات إضافية أو تخصيصات مستقبلية */
