* {
    box-sizing: border-box;
}

:root {
    --auth-card-max-width: 520px;
    --auth-card-min-height: 530px;
    --auth-card-radius: 28px;
    --auth-card-padding: 43px 48px 46px;
    --auth-card-mobile-max-width: 360px;
    --auth-card-mobile-radius: 18px;
    --auth-card-mobile-padding: 24px 26px 26px;
    --auth-shell-max-width: 1680px;
    --auth-shell-right-padding: 132px;
    --auth-shell-left-padding: 64px;
    --auth-panel-width: 580px;
}

:where(img) {
    max-width: 100%;
    height: auto;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #e7f0f7;
    background: url('../assets/img/try.png') no-repeat 15% center fixed;
    background-size: cover;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(980px 560px at 14% 56%, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 66%),
        linear-gradient(90deg, rgba(255, 255, 255, 0.00) 0%, rgba(231, 240, 247, 0.22) 62%, rgba(231, 240, 247, 0.36) 100%);
    pointer-events: none;
    z-index: 0;
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100vh;
    width: 100%;
    max-width: var(--auth-shell-max-width);
    margin: 0 auto;
    padding: 64px var(--auth-shell-right-padding) 64px var(--auth-shell-left-padding);
    gap: 0;
    background: transparent;
    position: relative;
    z-index: 1;
}

.auth-container,
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100vh;
    width: 100%;
    max-width: var(--auth-shell-max-width);
    margin: 0 auto;
    padding: 64px var(--auth-shell-right-padding) 64px var(--auth-shell-left-padding);
    gap: 0;
    background: transparent;
    position: relative;
    z-index: 1;
}

.auth-split-left {
    display: none;
}

.auth-split-right {
    width: var(--auth-panel-width);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 0;
    flex: 0 0 var(--auth-panel-width);
}

.login-card {
    width: min(100%, var(--auth-card-max-width));
    max-width: var(--auth-card-max-width);
    min-height: var(--auth-card-min-height);
    height: auto;
    padding: var(--auth-card-padding);
    border-radius: var(--auth-card-radius);
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow:
        0 18px 50px rgba(2, 6, 23, 0.18),
        0 2px 0 rgba(255, 255, 255, 0.45) inset;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.25), rgba(255, 255, 255, 0.0) 45%, rgba(15, 23, 42, 0.08));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

body.employee-login-page .login-container,
body.employee-login-page .auth-container,
body.employee-login-page .auth-wrapper {
    justify-content: flex-end;
    gap: 0;
}

body.employee-login-page .auth-split-left {
    display: none;
}

body.employee-login-page .auth-split-right {
    width: min(var(--auth-panel-width), 100%);
    flex: 0 0 var(--auth-panel-width);
}

body.employee-login-page .login-card {
    width: min(100%, 520px);
    max-width: 520px;
    min-height: 600px;
    padding: 40px 36px 42px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.back-btn:hover {
    color: #1B5E20;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 6px 0 10px;
}

.login-brand img {
    display: block;
    width: auto;
    max-width: 170px;
    max-height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 10px 18px rgba(2, 6, 23, 0.08));
}

.login-card h2 {
    margin: 0 0 28px;
    text-align: center;
    font-size: 30px;
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: #14532d;
}

.login-card form {
    background: none;
    padding: 0;
    box-shadow: none;
    max-width: 100%;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.input-shell {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
    pointer-events: none;
}

.input-shell input {
    width: 100%;
    height: 58px;
    padding: 0 18px 0 50px;
    border-radius: 18px;
    border: 1px solid #d6dee9;
    background: #eef5ff;
    font-size: 15px;
    color: #111827;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-shell input::placeholder {
    color: #9ca3af;
}

.input-shell input:focus {
    outline: none;
    border-color: #1B5E20;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(27, 94, 32, 0.12);
}

.input-shell.is-invalid input {
    border-color: #fecaca;
    background: #fef2f2;
    box-shadow: inset 0 0 0 1px #ef4444;
}

.input-shell.is-invalid .input-icon {
    color: #ef4444;
}

.password-wrapper .password-input {
    padding-right: 64px;
}

.forgot-link {
    display: inline-block;
    margin-top: 10px;
    color: #2f6b2f;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

.login-card form > button[type="submit"] {
    width: 100%;
    height: 64px;
    margin-top: 10px;
    border: none;
    border-radius: 18px;
    background: #166534;
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(13, 93, 34, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-card form > button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(13, 93, 34, 0.32);
}

.login-card .toggle-password {
    margin-top: 0;
    box-shadow: none;
}

.login-card .toggle-password:hover {
    box-shadow: none;
}

.error {
    background: #FEE2E2;
    color: #B91C1C;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 14px;
}

.success {
    background: #DCFCE7;
    color: #166534;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 14px;
}

.signup-link {
    text-align: center;
    margin-top: 20px;
    color: #64748b;
    font-size: 14px;
}

.signup-link a {
    color: #1B5E20;
    text-decoration: none;
    font-weight: 600;
}

.signup-link a:hover {
    text-decoration: underline;
}

.signup-link-hidden {
    display: none;
}

.auth-note {
    margin: 0 0 24px;
    text-align: center;
    color: #667085;
    font-size: 15px;
    line-height: 1.6;
}

.auth-note strong {
    color: #374151;
    font-weight: 700;
}

.otp-label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    text-align: left;
}

.otp-inputs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 10px;
}

.otp-digit {
    width: 100%;
    height: 64px;
    border-radius: 18px;
    border: 1px solid #d6dee9;
    background: #eef5ff;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.otp-digit:focus {
    outline: none;
    border-color: #1B5E20;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(27, 94, 32, 0.12);
}

.login-card .otp-error {
    margin-top: 10px;
    margin-bottom: 0;
}

.auth-inline-link {
    text-align: center;
    margin-top: 24px;
    color: #667085;
    font-size: 14px;
}

.auth-inline-link a {
    color: #1B5E20;
    text-decoration: none;
    font-weight: 700;
}

.auth-inline-link a:hover {
    text-decoration: underline;
}

.password-validation {
    margin-top: 10px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    display: none;
}

.password-validation ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.password-validation li {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    color: #64748b;
    transition: color 0.2s;
}

.password-validation li:last-child {
    margin-bottom: 0;
}

.password-validation li::before {
    content: '•';
    display: inline-block;
    width: 20px;
    text-align: center;
    margin-right: 8px;
    font-weight: bold;
}

.password-validation li.valid {
    color: #16a34a;
}

.password-validation li.valid::before {
    content: '✓';
}

.password-validation li.invalid {
    color: #dc2626;
}

.password-validation li.invalid::before {
    content: '✕';
}

.password-validation {
    margin-top: 12px;
    padding: 12px 14px;
    background: rgba(248, 250, 252, 0.92);
    border: 1px solid #dbe4ef;
    border-radius: 16px;
    font-size: 0.85rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.password-validation-title {
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.password-validation ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 14px;
}

.password-validation li {
    margin-bottom: 0;
    line-height: 1.3;
}

.password-validation li::before {
    content: '\2022';
    width: 14px;
    color: #94a3b8;
}

.password-validation li.valid::before {
    content: '\2713';
    color: #16a34a;
}

.password-validation li.invalid::before {
    content: '\2715';
    color: #dc2626;
}

@media (max-width: 900px) {
    .login-container,
    .auth-container,
    .auth-wrapper {
        height: auto;
        min-height: 100vh;
        flex-direction: column;
        justify-content: center;
        max-width: none;
        margin: 0;
        padding: 24px 18px 44px;
        gap: 26px;
    }

    .auth-split-left {
        width: 100%;
        height: auto;
        justify-content: center;
    }

    .auth-split-right {
        width: min(560px, 100%);
        padding: 0;
        flex: 0 0 auto;
    }

    .login-card {
        min-height: 0;
        padding: 40px 24px 34px;
    }

    body.employee-login-page .auth-split-right {
        width: min(520px, 100%);
        flex: 0 0 auto;
    }

    body.employee-login-page .login-card {
        width: min(100%, 520px);
        max-width: 520px;
        min-height: 0;
        padding: 40px 24px 34px;
    }
}

@media (max-width: 768px) {
    body {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        padding: 20px;
    }

    body::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.15);
        pointer-events: none;
        z-index: 0;
    }

    .login-container,
    .auth-container,
    .auth-wrapper {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        height: auto;
        min-height: 0;
        padding: 0;
        gap: 0;
    }

    .auth-split-left {
        display: none;
    }

    .auth-split-right {
        width: 100%;
        flex: 0 0 auto;
        height: auto;
    }

    .login-card {
        width: 100%;
        max-width: var(--auth-card-mobile-max-width);
        height: auto;
        min-height: 0;
        padding: var(--auth-card-mobile-padding);
        border-radius: var(--auth-card-mobile-radius);
    }

    body.employee-login-page .auth-split-right {
        width: 100%;
    }

    body.employee-login-page .login-card {
        width: 100%;
        max-width: var(--auth-card-mobile-max-width);
        min-height: 0;
        padding: var(--auth-card-mobile-padding);
        border-radius: var(--auth-card-mobile-radius);
    }

    .password-validation ul {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .login-card form > button[type="submit"] {
        height: 58px;
    }
}

@media (max-width: 480px) {
    .login-container,
    .auth-container,
    .auth-wrapper {
        padding: 18px 12px;
    }

    .login-card {
        width: 100%;
        max-width: var(--auth-card-mobile-max-width);
        padding: var(--auth-card-mobile-padding);
        border-radius: var(--auth-card-mobile-radius);
    }

    body.employee-login-page .login-card {
        width: 100%;
        max-width: var(--auth-card-mobile-max-width);
        padding: var(--auth-card-mobile-padding);
        border-radius: var(--auth-card-mobile-radius);
    }

    .back-btn {
        margin-bottom: 18px;
    }

    .login-card h2 {
        font-size: 24px;
        margin-bottom: 22px;
    }

    .input-shell input {
        height: 54px;
        padding-left: 46px;
    }

    .otp-inputs {
        gap: 8px;
    }

    .otp-digit {
        height: 56px;
        border-radius: 16px;
        font-size: 20px;
    }

    .login-card form > button[type="submit"] {
        height: 56px;
        border-radius: 16px;
    }
}
