*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --brand: #d87421;
    --brand-dark: #b85f18;
    --brand-light: #fff0e0;
    --brand-glow: rgba(216, 116, 33, 0.18);
    --ink: #1a1208;
    --ink-2: #4a3f35;
    --ink-3: #8a7e75;
    --surface: #fffcf7;
    --card-bg: rgba(255, 253, 248, 0.94);
    --border: rgba(216, 116, 33, 0.14);
    --input-bg: #fff;
    --input-border: #e8ddd2;
    --radius: 10px;
    --shadow-card: 0 8px 40px rgba(180, 100, 20, 0.13), 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-btn: 0 4px 16px rgba(216, 116, 33, 0.35);
}

html,
body {
    height: 100%;
    font-family: 'DM Sans', sans-serif;
    overflow: hidden;
}

/* ── PAGE ── */
.login-page {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fffbf4;
}

/* ── BACKGROUND ── */
.bg-texture {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

.bg-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(216, 116, 33, 0.04) 40px, rgba(216, 116, 33, 0.04) 41px),
        repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(216, 116, 33, 0.04) 40px, rgba(216, 116, 33, 0.04) 41px);
}

.bg-glow {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 70% 60% at 50% 45%, rgba(255, 220, 160, 0.28) 0%, rgba(255, 248, 230, 0.12) 55%, transparent 100%);
}

/* Orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
    animation: orbFloat 18s ease-in-out infinite alternate;
}

.orb-1 {
    width: 380px;
    height: 380px;
    top: -80px;
    left: -100px;
    background: rgba(216, 116, 33, 0.11);
    animation-duration: 22s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    bottom: -60px;
    right: -80px;
    background: rgba(253, 186, 116, 0.13);
    animation-duration: 26s;
    animation-delay: -8s;
}

.orb-3 {
    width: 220px;
    height: 220px;
    bottom: 15%;
    left: 20%;
    background: rgba(234, 179, 8, 0.07);
    animation-duration: 18s;
    animation-delay: -4s;
}

.orb-4 {
    width: 180px;
    height: 180px;
    top: 20%;
    right: 15%;
    background: rgba(216, 116, 33, 0.08);
    animation-duration: 30s;
    animation-delay: -12s;
}

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

    33% {
        transform: translate(30px, -40px) scale(1.08);
    }

    66% {
        transform: translate(-20px, 25px) scale(0.94);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

/* Floating dots */
.dots-field {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.dot {
    position: absolute;
    border-radius: 50%;
    background: rgba(216, 116, 33, 0.25);
    animation: dotDrift linear infinite;
}

@keyframes dotDrift {
    0% {
        transform: translateY(100vh) scale(0.4);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-10vh) scale(1.1);
        opacity: 0;
    }
}

/* Geometric shapes */
.shape {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    animation: shapeRotate linear infinite;
}

@keyframes shapeRotate {
    from {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(1.1);
    }

    to {
        transform: rotate(360deg) scale(1);
    }
}

.shape-hex {
    width: 80px;
    height: 80px;
    top: 12%;
    left: 8%;
    border: 1.5px solid rgba(216, 116, 33, 0.15);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: rgba(255, 220, 160, 0.08);
    animation-duration: 40s;
}

.shape-tri {
    width: 60px;
    height: 60px;
    bottom: 18%;
    right: 9%;
    border: 1.5px solid rgba(216, 116, 33, 0.12);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    background: rgba(255, 220, 160, 0.06);
    animation-duration: 55s;
}

.shape-ring {
    width: 120px;
    height: 120px;
    top: 55%;
    left: 6%;
    border: 2px solid rgba(216, 116, 33, 0.1);
    border-radius: 50%;
    animation-duration: 70s;
}

.shape-ring2 {
    width: 70px;
    height: 70px;
    top: 10%;
    right: 12%;
    border: 1.5px dashed rgba(216, 116, 33, 0.13);
    border-radius: 50%;
    animation-duration: 45s;
}

.shape-diam {
    width: 40px;
    height: 40px;
    bottom: 30%;
    left: 18%;
    border: 1.5px solid rgba(216, 116, 33, 0.1);
    transform: rotate(45deg);
    animation-duration: 60s;
}

.cross {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    color: rgba(216, 116, 33, 0.2);
    font-size: 20px;
    font-weight: 300;
    font-family: sans-serif;
    animation: crossPulse 4s ease-in-out infinite alternate;
}

@keyframes crossPulse {
    from {
        opacity: 0.3;
        transform: scale(0.9);
    }

    to {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Right stats panel */
.side-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 340px;
    background: linear-gradient(160deg, rgba(255, 240, 210, 0.6), rgba(255, 248, 230, 0.3));
    border-left: 1px solid rgba(216, 116, 33, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    z-index: 1;
    pointer-events: none;
}

.side-title {
    font-family: 'Sora', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
    margin-bottom: 10px;
    text-align: center;
}

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

.side-sub {
    font-size: 13px;
    color: var(--ink-3);
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.6;
}

.side-stat {
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(216, 116, 33, 0.12);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.stat-icon.orange {
    background: rgba(216, 116, 33, 0.12);
    color: var(--brand);
}

.stat-icon.green {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.stat-label {
    font-size: 11px;
    color: var(--ink-3);
    font-weight: 500;
    margin-bottom: 2px;
}

.stat-val {
    font-family: 'Sora', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
}

@media (max-width:820px) {
    .side-panel {
        display: none;
    }
}

/* ── FLIP CARD ── */
.flip-card-perspective {
    perspective: 2000px;
    z-index: 10;
    width: 420px;
    max-width: calc(100vw - 32px);
}

.flip-card-inner {
    position: relative;
    width: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.flip-card-inner.flipped {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    width: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: var(--card-bg);
    border: 1px solid rgba(216, 116, 33, 0.12);
    border-radius: 12px;
    padding: 32px 38px 28px;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px);
    position: relative;
}

.flip-card-back {
    position: absolute !important;
    top: 0;
    left: 0;
    height: 100%;
    transform: rotateY(180deg);
}

/* Top shimmer line */
.flip-card-front::before,
.flip-card-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(90deg, transparent, var(--brand), #f97316, var(--brand), transparent);
    background-size: 200% 100%;
    animation: shimmerLine 3s linear infinite;
}

@keyframes shimmerLine {
    0% {
        background-position: -100% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ── LOGO BADGE ── */
.logo-wrap {
    text-align: center;
    margin-bottom: 18px;
}

.logo-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--brand-light);
    border: 1px solid rgba(216, 116, 33, 0.2);
    border-radius: 10px;
    padding: 8px 18px;
}

.logo-icon {
    width: 28px;
    height: 28px;
    background: var(--brand);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
}

.logo-name {
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-dark);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ── HEADINGS ── */
.card-title {
    font-family: 'Sora', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
    text-align: center;
    line-height: 1.3;
    margin-bottom: 4px;
}

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

.card-sub {
    font-size: 13px;
    color: var(--ink-3);
    text-align: center;
    margin-bottom: 20px;
    font-weight: 500;
    line-height: 1.5;
}

.otp-sent-to {
    font-size: 12.5px;
    color: var(--ink-3);
    text-align: center;
    margin-bottom: 18px;
    line-height: 1.6;
}

.otp-sent-to strong {
    color: var(--ink);
    font-weight: 600;
}

/* ── ALERTS ── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 12.5px;
    font-weight: 500;
    margin-bottom: 14px;
    animation: alertIn 0.35s ease forwards;
    border: 1px solid transparent;
}

@keyframes alertIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: #f0fdf4;
    border-color: rgba(34, 197, 94, 0.25);
    color: #15803d;
}

.alert-danger {
    background: #fef2f2;
    border-color: rgba(239, 68, 68, 0.25);
    color: #b91c1c;
}

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

/* ── FORM FIELDS ── */
.form-group {
    margin-bottom: 14px;
}

.field-label {
    display: block !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: var(--ink-2) !important;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.input-group {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.input-group:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3.5px rgba(216, 116, 33, 0.12);
    transform: translateY(-1px);
}

.input-group .form-control {
    flex: 1;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 12px 14px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    font-family: 'DM Sans', sans-serif !important;
    color: var(--ink) !important;
    height: auto !important;
    border-radius: 0 !important;
}

.input-group .form-control::placeholder {
    color: #c4b8ac;
    font-weight: 400;
}

.input-group-text {
    background: transparent !important;
    border: none !important;
    padding: 0 14px 0 0 !important;
    color: #c4b8ac;
    font-size: 17px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.input-group:focus-within .input-group-text {
    color: var(--brand);
}

.field-error {
    font-size: 11.5px;
    color: #dc2626;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── SUBMIT BUTTON ── */
.btn.primary-button {
    width: 100%;
    border: none !important;
    cursor: pointer;
    background: linear-gradient(135deg, var(--brand) 0%, #f97316 100%) !important;
    color: #fff !important;
    border-radius: var(--radius) !important;
    padding: 13px 20px !important;
    font-family: 'Sora', sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
    box-shadow: var(--shadow-btn);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin-top: 4px;
}

.btn.primary-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    transform: skewX(-20deg);
    transition: left 0.55s ease;
}

.btn.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(216, 116, 33, 0.4) !important;
}

.btn.primary-button:hover::after {
    left: 120%;
}

.btn.primary-button:active {
    transform: translateY(0);
}

.btn.primary-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* ── DIVIDER ── */
.otp-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
}

.otp-divider hr {
    flex: 1;
    margin: 0;
    border-color: var(--border);
}

.otp-divider span {
    font-size: 11px;
    color: var(--ink-3);
    font-weight: 500;
    white-space: nowrap;
}

/* ── RESEND BUTTON ── */
#resendBtn {
    width: 100%;
    border: none !important;
    cursor: pointer;
    background: transparent !important;
    color: var(--ink-3) !important;
    border-radius: var(--radius) !important;
    padding: 10px 16px !important;
    font-family: 'DM Sans', sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    transition: color 0.2s, background 0.2s !important;
}

#resendBtn:hover:not(:disabled) {
    color: var(--brand) !important;
    background: var(--brand-light) !important;
}

#resendBtn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

#timer {
    background: #f1ede9;
    color: #94766a;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

/* ── BACK LINK ── */
#backToLoginLink {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-3) !important;
    text-decoration: none !important;
    transition: color 0.2s;
    margin-top: 6px;
}

#backToLoginLink:hover {
    color: var(--brand) !important;
}

/* ── FOOTER NOTE ── */
.card-secure-note {
    margin-top: 16px;
    text-align: center;
    font-size: 11px;
    color: var(--ink-3);
    letter-spacing: 0.02em;
}

/* ── SHAKE ── */
.shake-element {
    animation: shakeCard 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeCard {

    10%,
    90% {
        transform: translate3d(-2px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(4px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-5px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(5px, 0, 0);
    }
}

/* ── SPINNER ── */
.spinner-border {
    display: inline-block;
}