/* =====================================================
   AUTH THEME
===================================================== */

:root {
    --brand-green: #8BC34A;
    --brand-blue: #0E7CA6;
    --brand-dark: #111827;
    --auth-bg: #F3F6FA;
    --auth-surface: #FFFFFF;
    --auth-border: #DDE5EE;
    --auth-text: #172033;
    --auth-muted: #637083;
    --auth-danger: #C9303E;
    --auth-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
    min-height: 100%;
    overflow: hidden;
}

body {
    height: 100vh;
    height: 100svh;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(120deg, rgba(14, 124, 166, 0.08), rgba(139, 195, 74, 0.10)),
        var(--auth-bg);
    color: var(--auth-text);
    font-family: "Segoe UI", Arial, sans-serif;
    letter-spacing: 0;
    overflow: hidden;
}

a {
    color: var(--brand-blue);
    font-weight: 700;
    text-decoration: none;
}

a:hover {
    color: #095F7F;
    text-decoration: underline;
}

/* =====================================================
   LOGIN LAYOUT
===================================================== */

.auth-wrapper,
.login-wrapper {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(14px, 2.4vh, 28px);
}

.auth-shell {
    width: min(100%, 1040px);
    height: min(620px, calc(100vh - 84px));
    height: min(620px, calc(100svh - 84px));
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(340px, 0.94fr) minmax(380px, 1.06fr);
    overflow: hidden;
    border: 1px solid rgba(221, 229, 238, 0.9);
    border-radius: 8px;
    background: var(--auth-surface);
    box-shadow: var(--auth-shadow);
}

.auth-brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(24px, 4vh, 34px);
    overflow: hidden;
    background:
        linear-gradient(150deg, rgba(14, 124, 166, 0.96), rgba(17, 24, 39, 0.98)),
        #12344A;
    color: #FFFFFF;
}

.auth-brand-panel::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--brand-green), var(--brand-blue));
}

.brand-lockup {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-logo {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    object-fit: contain;
    border-radius: 8px;
    background: #FFFFFF;
    padding: 7px;
}

.brand-kicker {
    display: block;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.74);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.brand-lockup h1,
.brand-message h2,
.auth-card-header h2 {
    margin: 0;
    line-height: 1.16;
    letter-spacing: 0;
}

.brand-lockup h1 {
    font-size: 22px;
    font-weight: 800;
}

.brand-message {
    position: relative;
    z-index: 1;
    max-width: 360px;
}

.secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    margin-bottom: 20px;
    padding: 6px 11px;
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    color: #EAF7FD;
    font-size: 13px;
    font-weight: 700;
}

.brand-message h2 {
    font-size: clamp(30px, 4.3vw, 48px);
    font-weight: 800;
}

.brand-message p {
    max-width: 300px;
    margin: 14px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 16px;
    line-height: 1.6;
}

.auth-card,
.login-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #FFFFFF;
}

.auth-card {
    padding: clamp(24px, 4.2vw, 48px);
    animation: fadeSlide .45s ease both;
}

.login-card {
    max-width: 430px;
    padding: 34px;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    box-shadow: var(--auth-shadow);
}

.auth-card-header {
    margin-bottom: clamp(18px, 3vh, 28px);
}

.mobile-brand {
    display: none;
    align-items: center;
    gap: 9px;
    margin-bottom: 24px;
    color: #263248;
    font-weight: 800;
}

.mobile-brand img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.auth-card-header h2 {
    color: #111827;
    font-size: 30px;
    font-weight: 800;
}

.auth-card-header p {
    margin: 8px 0 0;
    color: var(--auth-muted);
    font-size: 15px;
    line-height: 1.5;
}

/* =====================================================
   FORM
===================================================== */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: clamp(14px, 2.2vh, 18px);
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-label,
.login-card label {
    margin: 0;
    color: #263248;
    font-size: 14px;
    font-weight: 800;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.label-row a {
    flex: 0 0 auto;
    font-size: 13px;
}

.input-with-icon,
.password-wrapper {
    position: relative;
}

.input-with-icon > i,
.password-wrapper > i {
    position: absolute;
    left: 14px;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    color: #7A8899;
    font-size: 17px;
    pointer-events: none;
}

.auth-card .form-control,
.login-card .form-control {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    background: #FFFFFF;
    color: var(--auth-text);
    font-size: 15px;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.auth-card .input-with-icon .form-control,
.auth-card .password-wrapper .form-control {
    padding-left: 43px;
}

.auth-card .password-wrapper .form-control {
    padding-right: 50px;
}

.auth-card .form-control::placeholder {
    color: #9AA7B6;
}

.auth-card .form-control:focus,
.login-card .form-control:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 4px rgba(14, 124, 166, 0.14);
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    z-index: 3;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #66758A;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.toggle-password:hover,
.toggle-password:focus {
    background: #EEF6F9;
    color: var(--brand-blue);
    outline: 0;
}

.caps-warning {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--auth-danger);
    font-size: 12px;
    font-weight: 700;
}

.auth-btn {
    width: 100%;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 4px;
    border: 0;
    border-radius: 8px;
    background: var(--brand-blue);
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.auth-btn:hover,
.auth-btn:focus {
    background: #095F7F;
    box-shadow: 0 12px 24px rgba(14, 124, 166, 0.22);
    transform: translateY(-1px);
}

.auth-btn:disabled {
    cursor: wait;
    opacity: .78;
    transform: none;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 20px;
    border: 1px solid #F2C2C8;
    border-radius: 8px;
    background: #FFF3F4;
    color: #8D1F2B;
    font-weight: 700;
}

.auth-alert-success {
    border-color: #BFE7CF;
    background: #F0FBF4;
    color: #166534;
}

/* =====================================================
   LEGACY AUTH PAGES
===================================================== */

.login-wrapper {
    min-height: calc(100vh - 45px);
}

.login-card h5 {
    color: #111827;
    font-size: 22px;
    font-weight: 800;
}

.login-card .btn-primary {
    min-height: 46px;
    border-radius: 8px;
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    font-weight: 800;
}

.login-card .btn-primary:hover {
    background: #095F7F;
    border-color: #095F7F;
}

/* =====================================================
   FOOTER
===================================================== */

.auth-footer,
.app-footer {
    flex: 0 0 auto;
    padding: 10px 18px;
    margin: 0;
    border: 0;
    background: transparent;
    color: #5C697A;
    text-align: center;
    font-size: 13px;
}

/* =====================================================
   ANIMATIONS
===================================================== */

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

@keyframes shakeCard {
    0%, 100% {
        transform: translateX(0);
    }
    20%, 60% {
        transform: translateX(-7px);
    }
    40%, 80% {
        transform: translateX(7px);
    }
}

.shake {
    animation: shakeCard .35s ease both;
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 900px) {
    .auth-wrapper {
        align-items: stretch;
        padding: clamp(12px, 2vh, 22px);
    }

    .auth-shell {
        height: 100%;
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        min-height: 210px;
        padding: 26px;
    }

    .brand-message h2 {
        font-size: 34px;
    }

    .brand-message p {
        max-width: none;
    }
}

@media (max-width: 640px) {
    body {
        background: #FFFFFF;
        overflow: hidden;
    }

    .auth-wrapper,
    .login-wrapper {
        padding: 0;
    }

    .auth-shell {
        height: 100%;
        min-height: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-brand-panel {
        display: none;
    }

    .auth-card {
        justify-content: center;
        padding: 20px;
    }

    .mobile-brand {
        display: flex;
    }

    .auth-card-header h2 {
        font-size: 26px;
    }

    .label-row {
        align-items: flex-start;
    }

    .auth-footer {
        background: #FFFFFF;
    }

    .login-card {
        min-height: 0;
        height: 100%;
        max-width: none;
        justify-content: center;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
}

@media (max-height: 680px) and (min-width: 641px) {
    .auth-shell {
        height: calc(100svh - 70px);
    }

    .auth-logo {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
    }

    .brand-message h2 {
        font-size: 34px;
    }

    .brand-message p,
    .auth-card-header p {
        font-size: 14px;
    }

    .auth-card-header h2 {
        font-size: 26px;
    }

    .auth-card .form-control,
    .login-card .form-control,
    .auth-btn {
        min-height: 44px;
    }
}
