@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
}

body {
    font-family: 'Cairo', sans-serif;
    background: #ffffff;
}

/* ===========================
        Main Layout
=========================== */

.login-page {
    display: flex;
    flex-direction: row-reverse;
    width: 100%;
    height: 100vh;
}

.left-side, .right-side {
    width: 50%;
    height: 100%;
}

/* ===========================
        Left Side
=========================== */

.left-side {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    padding: 28px 48px;
}

.form-wrapper {
    width: 430px;
}

/* ===========================
        Logo
=========================== */

.logo {
    width: 76px;
    aspect-ratio: 100/93;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto 12px;
}

/* ===========================
        Headings
=========================== */

h1 {
    font-size: 34px;
    font-weight: 900;
    text-align: center;
    color: #151515;
    margin-bottom: 6px;
}

.subtitle {
    text-align: center;
    color: #7b7b7b;
    font-size: 14px;
    margin-bottom: 16px;
}

/* ===========================
            Tabs
=========================== */

.switch-box {
    display: flex;
    background: #ECECEC;
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 16px;
}

.switch-box button {
    width: 50%;
    border: none;
    background: transparent;
    height: 38px;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Cairo', sans-serif;
    transition: .3s;
    cursor: pointer;
}

.switch-box .active {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

/* ===========================
        Labels
=========================== */

label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #444;
}

/* ===========================
        Inputs (merged box)
=========================== */

.input-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #f2f4f6;
    margin-bottom: 10px;
    transition: .3s;
    height: 52px;
}

.input-group:focus-within {
    border-color: #7b1974;
}

.input-group-text {
    width: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none !important;
    color: #888;
    order: -1; /* على اليمين افتراضياً */
}

.input-group-text.toggle-password,
.input-group-text.password-toggle {
    order: 2; /* على الشمال */
    margin-right: auto;
    cursor: pointer;
}

.input-group-text.toggle-password:hover i,
.input-group-text.password-toggle:hover i {
    color: #7b1974;
    transform: scale(1.1);
    transition: all 0.2s ease;
}

.form-control,
.form-select {
    height: 42px;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    font-size: 14px;
    font-family: 'Cairo', sans-serif;
    background-color: transparent !important;
    flex: 1;
    padding: 0 12px;
}

.form-control:focus,
.form-select:focus {
    box-shadow: none;
    outline: none;
}

/* ===========================
        Phone Input
=========================== */

.phone-input {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 52px;
    background: #F2F4F6;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: .3s;
    margin-bottom: 10px;
}

.phone-input:focus-within {
    border-color: #7b1974;
}

.phone-input input {
    flex: 1;
    height: 100%;
    border: 0;
    outline: none;
    background: transparent;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    padding: 0 14px;
    text-align: right;
    direction: ltr;
}

.phone-input input::placeholder {
    color: #888;
}

.phone-code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 95px;
    height: 100%;
    color: #888;
    border-left: 1px solid #ddd;
    background: transparent;
    flex-shrink: 0;
}

.phone-code i {
    font-size: 16px;
}

.phone-code span {
    font-size: 14px;
    font-weight: 600;
}

/* ===========================
        Login Button
=========================== */

.login-btn {
    width: 100%;
    height: 46px;
    background: #7b1974;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: .3s;
}

.login-btn:hover {
    background: #5e1359;
}

/* ===========================
        Forgot Password Link
=========================== */

a[data-field="login"] {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 12px;
    line-height: 16px;
    letter-spacing: 0.6px;
    text-align: right;
    color: #006A61;
    text-decoration: none;
    display: inline-block;
    width: 111px;
}

a[data-field="login"]:hover {
    text-decoration: underline;
}

/* ===========================
        Right Side
=========================== */

.right-side {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 48px;
    background: linear-gradient(90deg, #F4F6FA 0%, #EEF2F8 65%, #DFF5F2 100%);
}

.right-content {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.banner {
    width: 100%;
    max-width: 440px;
    height: auto;
    margin-bottom: 22px;
}

.right-content h2 {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    margin-bottom: 10px;
}

.right-content p {
    width: 420px;
    max-width: 100%;
    color: #777;
    font-size: 15px;
    line-height: 1.8;
    margin: 0;
}

/* ===========================
        Back & Reset Buttons
=========================== */

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #7b1974;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 18px;
    padding: 0;
}

.back-btn:hover {
    color: #5e1359;
}

.back-btn i {
    transition: .25s;
}

.back-btn:hover i {
    transform: translateX(4px);
}

#back-login {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: #7b1974;
    font-weight: 700;
    text-decoration: none;
    border: none;
    background: transparent;
}

#back-login:hover {
    color: #5e1359;
    text-decoration: none;
}

/* ===========================
        Forgot & Reset Views
=========================== */

#forgot-view, #reset-view {
    width: 100%;
    text-align: right;
}

#forgot-view h1, #reset-view h1,
#forgot-view .subtitle, #reset-view .subtitle {
    text-align: center;
}

#forgot-view h1, #reset-view h1 {
    font-size: 34px;
    font-weight: 900;
    color: #151515;
    margin-bottom: 8px;
}

#forgot-view .subtitle, #reset-view .subtitle {
    font-size: 14px;
    color: #7b7b7b;
    margin-bottom: 28px;
}

#forgot-form {
    margin-top: 10px;
}

/* ===========================
        Mobile Layout
=========================== */

@media (max-width: 640px) {
    .login-page {
        flex-direction: column-reverse;
        height: auto;
        overflow-y: auto;
    }

    .left-side, .right-side {
        width: 100%;
        height: auto;
    }

    .right-side {
        padding: 32px 20px;
    }

    .left-side {
        padding: 40px 20px;
    }

    .form-wrapper {
        width: 100%;
        max-width: 430px;
    }

    h1 {
        font-size: 30px;
    }

    .subtitle {
        font-size: 13px;
    }

    .banner {
        max-width: 300px;
    }

    .login-btn {
        height: 48px;
    }

    #forgot-view {
        padding-top: 10px;
    }
}