/* =========================================================
   ROOT VARIABLES & RESET
========================================================= */
:root {
    --bg-dark: #040a17;
    --bg-card: rgba(8, 20, 38, 0.82);
    --cyan-glow: #00e5ff;
    --cyan-bright: #38bdf8;
    --blue-accent: #2563eb;
    --text-main: #ffffff;
    --text-muted: #cbd5e1;
    --text-sub: #94a3b8;
    --border-glass: rgba(56, 189, 248, 0.28);
    --input-bg: #ffffff;
    --input-border: rgba(148, 163, 184, 0.30);
}

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

html,
body {
    width: 100%;
    min-height: 100%;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    overflow-y: auto;
}

/* =========================================================
   BACKGROUND CANVAS & GLOW ORBS
========================================================= */
.bg-scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: url("../images/new_login_page.png") center center / cover no-repeat;
}

.bg-scene::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(4, 10, 23, 0.55);
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.6;
    animation: orbFloat 16s ease-in-out infinite alternate;
}

.orb-1 {
    width: 500px;
    height: 500px;
    top: 10%;
    left: -100px;
    background: rgba(0, 229, 255, 0.20);
}

.orb-2 {
    width: 550px;
    height: 550px;
    bottom: 5%;
    right: -120px;
    background: rgba(37, 99, 235, 0.22);
    animation-delay: -8s;
}

@keyframes orbFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(40px, -30px) scale(1.12);
    }
}

#heroCanvas {
    position: fixed;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* =========================================================
   PAGE CONTAINER (SINGLE PAGE VIEW)
========================================================= */
.page-container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    overflow-x: hidden;
}

/* =========================================================
   TOP BRAND HEADER
========================================================= */
.top-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--text-main);
    transition: transform 0.3s ease;
}

.top-brand:hover {
    transform: translateY(-2px);
}

.brand-logo-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #00e5ff 0%, #0284c7 100%);
    display: grid;
    place-items: center;
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.55);
    position: relative;
}

.brand-logo-box::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    background: linear-gradient(135deg, #00e5ff, transparent, #0284c7);
    z-index: -1;
    opacity: 0.7;
}

.brand-db-svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.30rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: #ffffff;
    line-height: 1.1;
}

.brand-title span {
    color: var(--cyan-glow);
}

.brand-subtitle {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    margin-top: 3px;
}

/* =========================================================
   CENTER MEMBER LOGIN CARD
========================================================= */
.login-card-wrapper {
    width: 100%;
    max-width: 440px;
    margin: auto 0;
    padding: 14px 0;
    display: flex;
    justify-content: center;
}

.login-card {
    width: 100%;
    padding: 34px 34px 28px;
    border-radius: 20px;
    background: var(--bg-card);
    backdrop-filter: blur(28px) saturate(1.4);
    -webkit-backdrop-filter: blur(28px) saturate(1.4);
    border: 1px solid var(--border-glass);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.65),
        0 0 50px rgba(0, 229, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyan-glow), transparent);
}

.login-card:hover {
    border-color: rgba(0, 229, 255, 0.50);
    box-shadow:
        0 35px 90px rgba(0, 0, 0, 0.75),
        0 0 60px rgba(0, 229, 255, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.20);
}

.card-tag {
    text-align: center;
    font-family: 'Fira Code', monospace;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--cyan-bright);
    margin-bottom: 6px;
}

.card-title {
    text-align: center;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #ffffff;
    margin-bottom: 4px;
}

.card-title span {
    color: var(--cyan-glow);
    background: linear-gradient(135deg, #00e5ff 0%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-subtitle {
    text-align: center;
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 22px;
}

/* Inputs - White background, black icons */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.field-group label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #ffffff !important;
    letter-spacing: 0.02em;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-box {
    position: absolute;
    left: 12px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    pointer-events: none;
}

.input-icon-box svg {
    width: 16px;
    height: 16px;
    stroke: #1e293b;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.3s ease;
}

.input-group input {
    width: 100%;
    height: 40px;
    padding: 0 12px 0 52px;
    border-radius: 9px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #0f172a !important;
    font-size: 0.84rem;
    font-weight: 500;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.input-group input:focus {
    border-color: var(--cyan-bright);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.20);
    background: #ffffff;
}

.input-group input:focus+.input-icon-box svg,
.input-group:focus-within .input-icon-box svg {
    stroke: var(--cyan-glow);
}

/* Submit Button */
.submit-btn {
    width: 100%;
    height: 48px;
    margin-top: 6px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(90deg, #00e5ff 0%, #00b0ff 100%);
    color: #030914;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 30px rgba(0, 229, 255, 0.40);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transition: left 0.6s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 38px rgba(0, 229, 255, 0.60);
    background: linear-gradient(90deg, #38bdf8 0%, #00e5ff 100%);
}

.submit-btn:hover::before {
    left: 100%;
}

.btn-arrow {
    width: 18px;
    height: 18px;
    stroke: #030914;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.3s ease;
}

.submit-btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* Forgot Row */
.forgot-row {
    text-align: center;
    font-size: 0.76rem;
    color: #ffffff;
    margin-top: 14px;
    margin-bottom: 18px;
}

.forgot-row a {
    color: var(--cyan-bright);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-row a:hover {
    color: var(--cyan-glow);
    text-decoration: underline;
}

/* OR Divider */
.or-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin-bottom: 18px;
}

.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.or-divider span {
    padding: 0 14px;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-sub);
}

/* Action Buttons Row */
.card-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-back,
.btn-register {
    height: 40px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.80rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-back {
    background: rgba(15, 30, 52, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #ffffff;
}

.btn-back svg {
    width: 15px;
    height: 15px;
    stroke: #ffffff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s ease;
}

.btn-back:hover {
    background: rgba(30, 50, 80, 0.85);
    border-color: rgba(56, 189, 248, 0.45);
    color: #ffffff;
}

.btn-back:hover svg {
    transform: translateX(-3px);
}

.btn-register {
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.40);
    color: var(--cyan-bright);
}

.btn-register svg {
    width: 15px;
    height: 15px;
    stroke: var(--cyan-bright);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-register:hover {
    background: rgba(0, 229, 255, 0.20);
    border-color: var(--cyan-glow);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.30);
}

.btn-register:hover svg {
    stroke: #ffffff;
}

/* =========================================================
   COMPACT & SIMPLE POPUP MESSAGE PATTERN
========================================================= */
@keyframes simplePopIn {
    0% {
        opacity: 0;
        transform: translateY(-5px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.pop-message-box,
#Message.pop-message-box,
#forgotMessage.pop-message-box {
    display: none;
    position: relative;
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 8px 12px;
    font-size: 0.81rem;
    font-weight: 500;
    line-height: 1.35;
    animation: simplePopIn 0.22s ease-out forwards;
    transition: opacity 0.18s ease, transform 0.18s ease;
    box-sizing: border-box;
}

.pop-message-box.pop-closing {
    opacity: 0;
    transform: translateY(-4px);
}

.pop-message-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.pop-left-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.pop-dot-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pop-desc {
    flex: 1;
    word-break: break-word;
}

.pop-dismiss-btn {
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.5;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

.pop-dismiss-btn:hover {
    opacity: 1;
}

/* ERROR STATE */
.pop-message-box.pop-error,
#Message.error,
#forgotMessage.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #f87171;
}

.pop-message-box.pop-error .pop-dot-indicator,
#Message.error .pop-dot-indicator,
#forgotMessage.error .pop-dot-indicator {
    background: #ef4444;
    box-shadow: 0 0 5px rgba(239, 68, 68, 0.7);
}

/* SUCCESS STATE */
.pop-message-box.pop-success,
#Message.success,
#forgotMessage.success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.pop-message-box.pop-success .pop-dot-indicator,
#Message.success .pop-dot-indicator,
#forgotMessage.success .pop-dot-indicator {
    background: #10b981;
    box-shadow: 0 0 5px rgba(16, 185, 129, 0.7);
}

/* =========================================================
   FOOTER
========================================================= */
.page-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.74rem;
    color: #64748b;
    margin-top: 14px;
    width: 100%;
    padding: 0 4px;
}

.page-footer strong {
    color: #94a3b8;
    font-weight: 600;
}

.page-footer .footer-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-footer .footer-links a {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.page-footer .footer-links a:hover {
    color: #38bdf8;
}

@media (max-width: 520px) {
    .page-footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* =========================================================
   RESPONSIVE DESIGN (TABLETS, MOBILES, SMALL SCREENS)
========================================================= */
@media (max-width: 480px) {
    .page-container {
        padding: 12px 14px;
    }

    .top-brand {
        margin-top: 2px;
        margin-bottom: 6px;
    }

    .brand-logo-box {
        width: 40px;
        height: 40px;
    }

    .brand-db-svg {
        width: 22px;
        height: 22px;
    }

    .brand-title {
        font-size: 1.15rem;
    }

    .brand-subtitle {
        font-size: 0.54rem;
    }

    .login-card-wrapper {
        padding: 8px 0;
    }

    .login-card {
        padding: 24px 18px 20px;
        border-radius: 16px;
    }

    .card-title {
        font-size: 1.40rem;
    }

    .card-subtitle {
        margin-bottom: 18px;
    }

    .input-group input {
        height: 42px;
        font-size: 16px; /* Prevents auto-zoom on mobile iOS */
    }

    .submit-btn {
        height: 46px;
        font-size: 0.88rem;
    }

    .card-action-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .forgot-modal-card {
        padding: 26px 18px;
        border-radius: 16px;
    }

    .forgot-modal-card .card-title {
        font-size: 1.35rem !important;
    }
}

@media (max-width: 360px) {
    .login-card {
        padding: 20px 14px 16px;
    }

    .brand-subtitle {
        display: none;
    }

    .card-title {
        font-size: 1.25rem;
    }
}

/* =========================================================
   FORGOT PASSWORD MODAL (EMAIL OTP FLOW)
========================================================= */
.forgot-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(4, 10, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    overflow-y: auto;
}

.forgot-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.forgot-modal-card {
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: rgba(8, 20, 38, 0.95);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 34px 28px;
    box-shadow: 0 15px 45px rgba(0, 229, 255, 0.15);
    position: relative;
    transform: translateY(15px);
    transition: transform 0.25s ease;
}

.forgot-modal-overlay.active .forgot-modal-card {
    transform: translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 18px;
    background: transparent;
    border: none;
    color: var(--text-sub);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close-btn:hover {
    color: #ffffff;
}

.demo-badge-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 12.5px;
    color: #fde68a;
}

.demo-badge-banner mark {
    background: rgba(245, 158, 11, 0.3);
    color: #ffffff;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-weight: 700;
}

.otp-timer-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #e2e8f0;
}

.otp-timer-badge .timer-val {
    color: #00e5ff;
    font-weight: 700;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
}

.otp-timer-badge.expired {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.45);
    color: #fca5a5;
}

.otp-timer-badge.expired .timer-val {
    color: #f87171;
}

.otp-resend-link {
    display: inline-block;
    color: #38bdf8;
    text-decoration: none;
    font-size: 12.5px;
    transition: color 0.2s ease;
}

.otp-resend-link:hover {
    color: #00e5ff;
    text-decoration: underline;
}

/* =========================================================
   CLEAN & UNIQUE PASSWORD RECOVERY MODAL
========================================================= */
.clean-recovery-card {
    max-width: 460px;
    background: linear-gradient(165deg, rgba(8, 20, 38, 0.98) 0%, rgba(5, 13, 26, 0.98) 100%);
    border: 1px solid rgba(56, 189, 248, 0.35);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(0, 229, 255, 0.12);
    padding: 34px 30px;
    border-radius: 20px;
}

.modal-clean-sub {
    color: var(--text-sub);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.otp-clean-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 12.5px;
    color: #e2e8f0;
}

.timer-pill {
    font-family: 'Fira Code', monospace;
    font-weight: 700;
    color: #00e5ff;
    background: rgba(0, 229, 255, 0.15);
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 12px;
}

.timer-pill.expired {
    color: #f87171;
    background: rgba(239, 68, 68, 0.2);
}

/* ─── Formal Callouts ─── */
.formal-info-callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 12.5px;
    color: #cbd5e1;
    line-height: 1.5;
}

.formal-info-callout.highlight {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.32);
    color: #e2e8f0;
}

.formal-info-callout.success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #a7f3d0;
}

.formal-info-callout .callout-icon {
    font-size: 15px;
    line-height: 1.2;
}

.field-hint {
    display: block;
    margin-top: 5px;
    font-size: 11.5px;
    color: var(--text-sub);
}

/* ─── Timer Badge Details ─── */
.otp-timer-badge .timer-label {
    display: flex;
    align-items: center;
    gap: 7px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #00e5ff;
    border-radius: 50%;
    box-shadow: 0 0 8px #00e5ff;
    animation: pulseDotAnim 1.6s infinite ease-in-out;
}

@keyframes pulseDotAnim {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.85); }
}

.formal-resend-row {
    margin-top: 16px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-sub);
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

/* ─── Password Policy Card ─── */
.pwd-policy-card {
    background: rgba(6, 16, 32, 0.8);
    border: 1px dashed rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    padding: 10px 14px;
    margin: 14px 0 18px 0;
    font-size: 12px;
    color: #94a3b8;
}

.policy-header {
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.policy-list {
    margin: 0;
    padding-left: 18px;
}

.policy-list li {
    margin-bottom: 3px;
}

