.login-page {
    --ink-900: #0f1f3f;
    --ink-700: #2f466f;
    --ink-500: #687da4;
    --sky-100: #eaf0ff;
    --sky-200: #dce7ff;
    --sun-300: #f4c064;
    --sun-500: #d68f1f;
    --accent-500: #0a8b78;
    --surface: #ffffff;
    --line: #d5dff2;
    --focus: #1f57d6;
    --shadow-soft: 0 12px 35px rgba(16, 35, 76, 0.14);
    --shadow-deep: 0 22px 56px rgba(9, 25, 57, 0.18);

    padding: clamp(18px, 3vw, 36px);
    position: relative;
}

.login-page::before,
.login-page::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(6px);
}

.login-page::before {
    width: clamp(220px, 36vw, 420px);
    height: clamp(220px, 36vw, 420px);
    left: -80px;
    top: -100px;
    background: radial-gradient(circle, rgba(214, 143, 31, 0.24) 0%, rgba(214, 143, 31, 0) 72%);
}

.login-page::after {
    width: clamp(240px, 40vw, 460px);
    height: clamp(240px, 40vw, 460px);
    right: -100px;
    bottom: -130px;
    background: radial-gradient(circle, rgba(31, 87, 214, 0.2) 0%, rgba(31, 87, 214, 0) 70%);
}

.login-shell {
    max-width: 1180px;
    margin: 0 auto;
    min-height: min(82vh, 840px);
    border-radius: 28px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    background: var(--surface);
    box-shadow: var(--shadow-deep);
    position: relative;
    z-index: 1;
}

.pitch-panel {
    color: var(--ink-900);
    background:
        linear-gradient(130deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.58) 55%, rgba(255, 255, 255, 0.18) 100%),
        linear-gradient(164deg, var(--sky-100) 0%, #f2f6ff 55%, #f9ece0 100%);
    padding: clamp(28px, 5vw, 62px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
    border-right: 1px solid var(--line);
}

.pill-label {
    width: fit-content;
    margin: 0;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-700);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(47, 70, 111, 0.24);
    border-radius: 999px;
    padding: 7px 14px;
    font-weight: 700;
}

.brand-title {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
    max-width: 14ch;
}

.brand-subtitle {
    margin: 0;
    font-size: clamp(1rem, 1.9vw, 1.2rem);
    line-height: 1.6;
    color: var(--ink-700);
    max-width: 44ch;
}

.feature-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    gap: 12px;
    max-width: 420px;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #1c315d;
    font-size: clamp(0.94rem, 1.8vw, 1.04rem);
    opacity: 0;
    transform: translateY(10px);
    animation: reveal 0.55s ease forwards;
}

.feature-list li:nth-child(2) {
    animation-delay: 0.08s;
}

.feature-list li:nth-child(3) {
    animation-delay: 0.16s;
}

.feature-list li:nth-child(4) {
    animation-delay: 0.24s;
}

.check-icon {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e7f8f4;
    color: var(--accent-500);
    border: 1px solid rgba(10, 139, 120, 0.35);
    font-size: 0.82rem;
    font-weight: 800;
    flex-shrink: 0;
}

.form-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    display: grid;
    place-items: center;
    padding: clamp(22px, 4vw, 48px);
}

.login-form-card {
    width: min(460px, 100%);
    background: #ffffff;
    border: 1px solid #d9e2f4;
    border-radius: 22px;
    box-shadow: var(--shadow-soft);
    padding: clamp(24px, 4vw, 40px);
}

.form-header {
    margin-bottom: 24px;
}

.form-header .eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.73rem;
    color: var(--ink-500);
    font-weight: 700;
}

.form-header h2 {
    margin: 0;
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    line-height: 1.1;
    color: var(--ink-900);
    letter-spacing: -0.01em;
}

.support-text {
    margin: 10px 0 0;
    color: var(--ink-700);
    line-height: 1.55;
    font-size: 0.95rem;
}

.login-form {
    display: grid;
    gap: 16px;
}

.field-group {
    display: grid;
    gap: 7px;
}

.custom-label {
    font-size: 0.84rem;
    font-weight: 700;
    color: #233a66;
    letter-spacing: 0.02em;
}

.input-shell {
    height: 50px;
    border: 1px solid var(--line);
    background: #ffffff;
    border-radius: 13px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-shell:focus-within {
    border-color: var(--focus);
    box-shadow: 0 0 0 4px rgba(31, 87, 214, 0.15);
}

.input-icon {
    color: var(--ink-500);
    width: 28px;
    text-align: center;
    font-weight: 700;
    flex-shrink: 0;
}

.form-control {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: #142852;
    font-size: 0.96rem;
    min-width: 0;
}

.form-control::placeholder {
    color: #97a8c4;
}

.toggle-password {
    border: 0;
    background: rgba(31, 87, 214, 0.1);
    color: #1743a8;
    height: 34px;
    border-radius: 9px;
    padding: 0 12px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.toggle-password:hover {
    background: rgba(31, 87, 214, 0.16);
}

.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #233a66;
    font-size: 0.9rem;
}

.remember-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--focus);
}

.forgot-link {
    color: #1d4fcb;
    font-size: 0.88rem;
    font-weight: 700;
}

.forgot-link:hover {
    text-decoration: underline;
}

.btn-signin {
    margin-top: 4px;
    border: 0;
    border-radius: 13px;
    height: 50px;
    padding: 0 16px;
    width: 100%;
    color: #ffffff;
    background: linear-gradient(100deg, #b22a1f 0%, #d68f1f 100%);
    font-size: 0.96rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-signin:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(175, 54, 24, 0.3);
}

.signup-text {
    margin: 20px 0 0;
    text-align: center;
    color: #486089;
    font-size: 0.93rem;
}

.signup-text a {
    color: #1d4fcb;
    font-weight: 700;
}

.signup-text a:hover {
    text-decoration: underline;
}

body.auth-modal-open {
    overflow: hidden;
}

.auth-modal {
    --auth-modal-accent-1: #1f57d6;
    --auth-modal-accent-2: #86a4e8;
    --auth-modal-badge-bg: linear-gradient(135deg, rgba(31, 87, 214, 0.14), rgba(134, 164, 232, 0.2));
    --auth-modal-heading: #0f1f3f;
    --auth-modal-kicker: #36507a;
    --auth-modal-action-1: #1f57d6;
    --auth-modal-action-2: #163d98;

    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 99999;
    background: rgba(6, 13, 28, 0.58);
    backdrop-filter: blur(12px);
}

.auth-modal.hidden {
    display: none !important;
}

.auth-modal-backdrop {
    position: absolute;
    inset: 0;
}

.auth-modal-box {
    position: relative;
    width: min(480px, calc(100vw - 32px));
    padding: 28px 24px 24px;
    border-radius: 24px;
    border: 1px solid rgba(214, 223, 242, 0.92);
    background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
    box-shadow: 0 26px 80px rgba(7, 18, 41, 0.28);
    text-align: center;
    overflow: hidden;
    transform: translateY(16px) scale(0.98);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
    z-index: 1;
}

.auth-modal.visible .auth-modal-box {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.auth-modal-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--auth-modal-accent-1), var(--auth-modal-accent-2));
}

.auth-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(84, 104, 140, 0.18);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #52627f;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(17, 34, 69, 0.12);
}

.auth-modal-close:hover {
    color: #0f1f3f;
}

.auth-modal-badge {
    width: 72px;
    height: 72px;
    margin: 4px auto 14px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    background: var(--auth-modal-badge-bg);
    color: var(--auth-modal-action-1);
    border: 1px solid rgba(31, 87, 214, 0.12);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.auth-modal-eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--auth-modal-kicker);
}

.auth-modal-box h2 {
    margin: 0;
    color: var(--auth-modal-heading);
    font-size: clamp(1.3rem, 2.5vw, 1.75rem);
    line-height: 1.15;
}

.auth-modal-box p#authModalMessage {
    margin: 12px 0 0;
    color: #546680;
    line-height: 1.6;
    font-size: 0.96rem;
}

.auth-modal-actions {
    display: flex;
    justify-content: center;
    margin-top: 22px;
}

.auth-modal-primary {
    border: 0;
    border-radius: 999px;
    min-width: 138px;
    height: 44px;
    padding: 0 20px;
    background: linear-gradient(100deg, var(--auth-modal-action-1) 0%, var(--auth-modal-action-2) 100%);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(31, 87, 214, 0.24);
}

.auth-modal-primary:hover {
    transform: translateY(-1px);
}

.auth-modal.is-success {
    --auth-modal-accent-1: #0a8b78;
    --auth-modal-accent-2: #66d4c0;
    --auth-modal-badge-bg: linear-gradient(135deg, rgba(10, 139, 120, 0.14), rgba(102, 212, 192, 0.2));
    --auth-modal-heading: #06362f;
    --auth-modal-kicker: #0a6c5c;
    --auth-modal-action-1: #0a8b78;
    --auth-modal-action-2: #066457;
}

.auth-modal.is-warning {
    --auth-modal-accent-1: #d68f1f;
    --auth-modal-accent-2: #f1c36f;
    --auth-modal-badge-bg: linear-gradient(135deg, rgba(214, 143, 31, 0.15), rgba(241, 195, 111, 0.22));
    --auth-modal-heading: #6e4000;
    --auth-modal-kicker: #9a6112;
    --auth-modal-action-1: #d68f1f;
    --auth-modal-action-2: #ab6f10;
}

.auth-modal.is-error {
    --auth-modal-accent-1: #b22a1f;
    --auth-modal-accent-2: #f07f73;
    --auth-modal-badge-bg: linear-gradient(135deg, rgba(178, 42, 31, 0.14), rgba(240, 127, 115, 0.2));
    --auth-modal-heading: #64130e;
    --auth-modal-kicker: #8d1f17;
    --auth-modal-action-1: #b22a1f;
    --auth-modal-action-2: #8d1d14;
}

.auth-modal.is-info {
    --auth-modal-accent-1: #1f57d6;
    --auth-modal-accent-2: #86a4e8;
    --auth-modal-badge-bg: linear-gradient(135deg, rgba(31, 87, 214, 0.14), rgba(134, 164, 232, 0.2));
    --auth-modal-heading: #0f1f3f;
    --auth-modal-kicker: #36507a;
    --auth-modal-action-1: #1f57d6;
    --auth-modal-action-2: #163d98;
}

.auth-modal.is-success .auth-modal-badge,
.auth-modal.is-warning .auth-modal-badge,
.auth-modal.is-error .auth-modal-badge,
.auth-modal.is-info .auth-modal-badge {
    color: var(--auth-modal-action-1);
}

.auth-modal.is-success .auth-modal-primary,
.auth-modal.is-warning .auth-modal-primary,
.auth-modal.is-error .auth-modal-primary,
.auth-modal.is-info .auth-modal-primary {
    background: linear-gradient(100deg, var(--auth-modal-action-1) 0%, var(--auth-modal-action-2) 100%);
}

.auth-modal.is-success .auth-modal-close,
.auth-modal.is-warning .auth-modal-close,
.auth-modal.is-error .auth-modal-close,
.auth-modal.is-info .auth-modal-close {
    color: var(--auth-modal-kicker);
}

@media (max-width: 520px) {
    .auth-modal {
        padding: 14px;
    }

    .auth-modal-box {
        padding: 24px 18px 20px;
        border-radius: 20px;
    }

    .auth-modal-badge {
        width: 64px;
        height: 64px;
        border-radius: 20px;
    }

    .auth-modal-primary {
        width: 100%;
        min-width: 0;
    }
}

/* Disabled button UX */
#loginButton.disabled {
  cursor: not-allowed;
  opacity: 0.6;
  pointer-events: none;
}

/* Shake animation */
@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}

.shake {
  animation: shake 0.2s linear 10; /* ~2 seconds total */
}

@keyframes reveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 980px) {
    .login-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .pitch-panel {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
}

@media (max-width: 620px) {
    .login-page {
        padding: 10px;
    }

    .pitch-panel {
        padding: 22px 18px;
    }

    .form-panel {
        padding: 14px;
    }

    .login-form-card {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .meta-row {
        flex-direction: column;
        align-items: flex-start;
    }
}