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

:root {
    --blue: #1a3b8c;
    --blue-mid: #2952c4;
    --blue-light: #e8eeff;
    --dark: #0d1b3e;
    --gray: #7a849a;
    --border: #e8e8e8;
    --white: #ffffff;
    --red: #dc3545;
    /* Tracks zoom & window resize: shrink type/spacing instead of scrolling */
    --login-pad-inline: clamp(0.85rem, 3.2vmin, 3.5rem);
    --login-pad-block: clamp(0.65rem, 2.4vmin, 4.25rem);
}

html {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* rem-based sizes follow this — zoom / short windows scale the whole UI */
    font-size: clamp(10px, min(1.65vmin, 0.55vw + 0.85vh), 16px);
}

body {
    font-family: 'Poppins', Arial, sans-serif;
    height: 100%;
    max-height: 100dvh;
    margin: 0;
    display: flex;
    align-items: stretch;
    background: var(--white);
    overflow: hidden;
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.is-hidden {
    display: none !important;
}

/* ===== LEFT PANEL ===== */
.left-panel {
    width: 50%;
    flex: 0 0 50%;
    max-width: 100%;
    min-height: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--login-pad-block) var(--login-pad-inline);
    position: relative;
    overflow: hidden;
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
    background-image: url('images/warehousebg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.left-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(120, 75, 0, 0.82) 0%,
        rgba(200, 145, 0, 0.74) 42%,
        rgba(90, 55, 0, 0.86) 100%
    );
    z-index: 1;
}

.left-panel::after {
    content: '';
    position: absolute;
    bottom: clamp(-5rem, -15vmin, -3rem);
    right: clamp(-5rem, -15vmin, -3rem);
    width: clamp(11rem, 36vmin, 17.5rem);
    height: clamp(11rem, 36vmin, 17.5rem);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    z-index: 1;
}

.left-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: min(30rem, 100%);
    min-height: 0;
    flex: 1 1 auto;
    margin: 0 auto;
    overflow: hidden;
}

.left-logo {
    width: clamp(7rem, 32vmin, 12.5rem);
    max-width: 82%;
    margin-bottom: clamp(0.65rem, 2vmin, 1.5rem);
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.3));
    animation: fadeUp 0.6s ease forwards;
}

.left-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
    margin-bottom: clamp(0.35rem, 1vmin, 0.62rem);
    animation: fadeUp 0.6s ease 0.08s both;
}

.left-title {
    font-size: clamp(1.15rem, 3.6vmin, 2.05rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: clamp(0.45rem, 1.2vmin, 0.88rem);
    animation: fadeUp 0.6s ease 0.1s both;
}

.left-sub {
    font-size: clamp(0.78rem, 2.1vmin, 1rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.78);
    max-width: 25rem;
    line-height: 1.45;
    margin-bottom: clamp(0.55rem, 1.8vmin, 2rem);
    animation: fadeUp 0.6s ease 0.2s both;
}

.feature-cards {
    display: flex;
    flex-direction: column;
    gap: clamp(0.4rem, 1.2vmin, 0.88rem);
    width: 100%;
    max-width: 26.25rem;
    flex-shrink: 1;
    min-height: 0;
}

.feature-card {
    display: flex;
    align-items: center;
    gap: clamp(0.55rem, 1.8vmin, 1.12rem);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    padding: clamp(0.45rem, 1.4vmin, 1rem) clamp(0.6rem, 1.8vmin, 1.35rem);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    animation: fadeUp 0.5s ease both;
    text-align: left;
}

.feature-card:nth-child(1) {
    animation-delay: 0.22s;
}
.feature-card:nth-child(2) {
    animation-delay: 0.3s;
}
.feature-card:nth-child(3) {
    animation-delay: 0.38s;
}

.fc-icon {
    width: clamp(2.15rem, 7vmin, 3.125rem);
    height: clamp(2.15rem, 7vmin, 3.125rem);
    min-width: clamp(2.15rem, 7vmin, 3.125rem);
    background: rgba(180, 120, 0, 0.85);
    border: 1.5px solid rgba(255, 230, 150, 0.45);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fffef5;
    font-size: clamp(0.95rem, 2.8vmin, 1.25rem);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.fc-text {
    font-size: clamp(0.74rem, 2vmin, 0.95rem);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.5;
    text-align: left;
}

.fc-text strong {
    font-weight: 700;
    color: #fff;
}

.left-secure-note {
    margin-top: clamp(0.5rem, 1.8vmin, 1.75rem);
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.52);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    animation: fadeUp 0.5s ease 0.45s both;
}

.left-secure-note i {
    font-size: 1rem;
}

/* ===== RIGHT PANEL ===== */
.right-panel {
    flex: 1 1 50%;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(0.25rem, 1vmin, 0.85rem);
    padding: var(--login-pad-block) var(--login-pad-inline);
    background: var(--white);
    overflow: hidden;
}

.form-card {
    width: 100%;
    max-width: 26.25rem;
    min-height: 0;
    flex: 0 1 auto;
    overflow: visible;
}

.form-header {
    margin-bottom: clamp(0.85rem, 2.2vmin, 1.85rem);
    animation: fadeUp 0.5s ease 0.1s both;
}

.form-title {
    font-size: clamp(1.35rem, 4vmin, 2rem);
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.form-title span {
    color: var(--blue-mid);
}

.form-subtitle {
    font-size: clamp(0.8rem, 2.05vmin, 0.97rem);
    color: var(--gray);
    font-weight: 400;
    line-height: 1.5;
}

.timeout-alert {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid #fcd34d;
    color: #92400e;
}

.error-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fff0f0;
    border: 1px solid #f5c6cb;
    border-radius: 10px;
    padding: clamp(0.45rem, 1.2vmin, 0.75rem) clamp(0.55rem, 1.4vmin, 1rem);
    font-size: clamp(0.8rem, 1.95vmin, 0.92rem);
    font-weight: 500;
    margin-bottom: clamp(0.55rem, 1.5vmin, 1.35rem);
    animation: fadeUp 0.4s ease both;
    line-height: 1.45;
}

.error-alert i {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.form-group {
    margin-bottom: clamp(0.65rem, 1.8vmin, 1.25rem);
    animation: fadeUp 0.5s ease both;
}

.form-group:nth-of-type(1) {
    animation-delay: 0.18s;
}
.form-group:nth-of-type(2) {
    animation-delay: 0.24s;
}

.form-label {
    display: block;
    font-size: 0.93rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.input-wrap {
    position: relative;
}

.input-field {
    width: 100%;
    padding: clamp(0.55rem, 1.5vmin, 0.875rem) clamp(0.65rem, 1.6vmin, 1.125rem) clamp(0.55rem, 1.5vmin, 0.875rem) 2.875rem;
    font-size: clamp(0.82rem, 2vmin, 0.97rem);
    font-family: 'Poppins', Arial, sans-serif;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: #fafafa;
    color: var(--dark);
    transition: all 0.25s ease;
    outline: none;
}

.input-field::placeholder {
    color: #c0c7d4;
}

.input-field:focus {
    border-color: var(--blue-mid);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(41, 82, 196, 0.1);
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #c0c7d4;
    font-size: 15px;
    pointer-events: none;
    transition: color 0.2s;
}

.input-field:focus ~ .input-icon {
    color: var(--blue-mid);
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    color: #c0c7d4;
    font-size: 16px;
    padding: 8px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.toggle-password:hover {
    color: var(--gray);
    background: rgba(41, 82, 196, 0.06);
}

.options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    animation: fadeUp 0.5s ease 0.28s both;
}

.remember-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.89rem;
    color: var(--gray);
    font-weight: 500;
    cursor: pointer;
}

.remember-wrap input {
    width: 16px;
    height: 16px;
    accent-color: var(--blue-mid);
    cursor: pointer;
}

.forgot-link {
    font-size: 0.88rem;
    color: var(--blue-mid);
    font-weight: 500;
    text-decoration: none;
}

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

.btn-row {
    display: flex;
    gap: clamp(0.45rem, 1.4vmin, 0.75rem);
    margin-top: clamp(0.45rem, 1.2vmin, 0.875rem);
    animation: fadeUp 0.5s ease 0.32s both;
}

.btn-login {
    flex: 2;
    position: relative;
    padding: clamp(0.55rem, 1.5vmin, 0.875rem);
    font-size: clamp(0.88rem, 2.1vmin, 1rem);
    font-weight: 600;
    font-family: 'Poppins', Arial, sans-serif;
    background: var(--blue-mid);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 16px rgba(41, 82, 196, 0.35);
    min-height: clamp(2.35rem, 7vmin, 3.125rem);
}

.btn-login:hover:not(:disabled) {
    background: var(--blue);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(41, 82, 196, 0.4);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    cursor: wait;
    opacity: 0.92;
}

.btn-login-leading {
    font-size: 1.1rem;
}

.btn-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
}

.btn-spinner.is-active {
    display: block;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-clear {
    flex: 1;
    padding: clamp(0.55rem, 1.5vmin, 0.875rem);
    font-size: clamp(0.84rem, 2vmin, 0.97rem);
    font-weight: 500;
    font-family: 'Poppins', Arial, sans-serif;
    background: transparent;
    color: var(--gray);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-clear:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: var(--dark);
}

.login-footnote {
    margin-top: 0;
    flex-shrink: 0;
    text-align: center;
    font-size: clamp(0.68rem, 1.65vmin, 0.8rem);
    color: #a0a8b8;
    font-weight: 500;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .left-panel {
        width: 46%;
        flex: 0 0 46%;
    }
}

@media (max-width: 768px) {
    html {
        height: 100dvh;
        max-height: 100dvh;
    }

    body {
        flex-direction: column;
        height: 100%;
        max-height: 100%;
        overflow: hidden;
        min-height: 0;
    }

    .left-panel {
        width: 100%;
        flex: 1 1 48%;
        min-height: 0;
        border-radius: 0 0 24px 24px;
        border-top-right-radius: 0;
    }

    .right-panel {
        flex: 1 1 52%;
        min-height: 0;
    }

    .left-content {
        max-width: 32.5rem;
    }

    .feature-cards {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: clamp(0.35rem, 1vmin, 0.62rem);
        max-width: 33.75rem;
    }

    .feature-card {
        flex: 1 1 45%;
        min-width: min(100%, 12.5rem);
        max-width: 16.25rem;
    }

    .left-secure-note {
        margin-top: clamp(0.35rem, 1.2vmin, 1.12rem);
    }

    .form-card {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .feature-cards {
        gap: clamp(0.3rem, 0.9vmin, 0.5rem);
    }

    .feature-card {
        flex: 1 1 100%;
        max-width: 22.5rem;
    }
}

@media (max-width: 400px) {
    .btn-row {
        flex-direction: column;
        gap: 10px;
    }

    .btn-login,
    .btn-clear {
        flex: unset;
        width: 100%;
    }

    .options-row {
        flex-direction: column;
        align-items: flex-start;
    }
}
