:root {
    --qfs-bg: #020202;
    --qfs-surface-1: rgba(18, 18, 18, 0.72);
    --qfs-surface-2: rgba(5, 5, 5, 0.88);
    --qfs-text-strong: #ffffff;
    --qfs-text-muted: #a7a7a7;
    --qfs-accent: #d4af37;
    --qfs-accent-strong: #fde08b;
    --qfs-border: rgba(212, 175, 55, 0.24);
    --qfs-border-strong: rgba(212, 175, 55, 0.68);
    --qfs-error-bg: rgba(78, 11, 11, 0.75);
    --qfs-error-text: #ffd8d8;
    --qfs-radius-alert: 12px;
    --qfs-radius-input: 12px;
    --qfs-radius-card: 24px;
    --qfs-radius-button: 16px;
    --qfs-space-4: 4px;
    --qfs-space-8: 8px;
    --qfs-space-12: 12px;
    --qfs-space-16: 16px;
    --qfs-space-24: 24px;
    --qfs-space-32: 32px;
    --qfs-space-40: 40px;
    --qfs-space-48: 48px;
    --qfs-shadow-card:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 0 30px rgba(212, 175, 55, 0.05),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    --qfs-shadow-button: 0 18px 34px rgba(0, 0, 0, 0.34);
    --qfs-shadow-focus: 0 0 20px rgba(212, 175, 55, 0.35);
    --qfs-font-body: "Inter", sans-serif;
    --qfs-font-label: "Inter", sans-serif;
    --qfs-font-display: "Inter", sans-serif;
    --qfs-auth-font-body: "Rajdhani", sans-serif;
    --qfs-auth-font-display: "Cinzel", serif;
    --qfs-font-size-h1: 32px;
    --qfs-font-size-h2: 24px;
    --qfs-font-size-body: 16px;
    --qfs-font-size-body-compact: 14px;
    --qfs-font-size-caption: 12px;
    --qfs-font-size-input-min: 16px;
    --qfs-line-height-heading: 1.2;
    --qfs-line-height-body: 1.5;
    --qfs-line-height-body-compact: 1.5;
}

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

.qfs-auth-page {
    min-height: 100vh;
    margin: 0;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 18%, rgba(212, 175, 55, 0.18), transparent 30%),
        radial-gradient(circle at 50% 100%, rgba(97, 76, 22, 0.16), transparent 42%),
        linear-gradient(180deg, #090909 0%, #030303 52%, #010101 100%);
    color: var(--qfs-text-strong);
    font-family: var(--qfs-auth-font-body);
}

.qfs-auth-canvas,
.qfs-auth-mesh,
.qfs-auth-texture {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.qfs-auth-canvas {
    z-index: 0;
}

.qfs-auth-mesh {
    inset: -50%;
    z-index: 1;
    background-image:
        linear-gradient(rgba(212, 175, 55, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 175, 55, 0.08) 1px, transparent 1px);
    background-size: 56px 56px;
    transform: perspective(1000px) rotateX(64deg) translateZ(-100px);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000, transparent 80%);
    mask-image: radial-gradient(circle at 50% 50%, #000, transparent 80%);
    opacity: 0.8;
    animation: qfs-mesh-drift 18s linear infinite;
}

.qfs-auth-texture {
    z-index: 2;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.qfs-auth-main {
    position: relative;
    z-index: 3;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding:
        max(20px, env(safe-area-inset-top))
        24px
        max(24px, env(safe-area-inset-bottom))
        24px;
}

.qfs-auth-shell {
    width: 100%;
    max-width: 420px;
}

.qfs-auth-brand {
    margin-bottom: var(--qfs-space-32);
    text-align: center;
}

.qfs-eyebrow {
    margin: 0;
    color: rgba(212, 175, 55, 0.6);
    font-family: var(--qfs-auth-font-body);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.4em;
    text-transform: uppercase;
}

.qfs-auth-brand-eyebrow {
    margin-bottom: 12px;
}

.qfs-eyebrow-left {
    margin-bottom: var(--qfs-space-8);
}

.qfs-auth-brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.qfs-auth-brand-line {
    width: 32px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--qfs-accent));
}

.qfs-auth-brand-line:last-child {
    background: linear-gradient(270deg, transparent, var(--qfs-accent));
}

.qfs-display-title {
    margin: 0;
    font-family: var(--qfs-auth-font-display);
    font-size: clamp(30px, 4vw, 38px);
    font-weight: 700;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    color: transparent;
    background: linear-gradient(180deg, #ffffff 0%, var(--qfs-accent-strong) 58%, var(--qfs-accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 0 0 18px rgba(212, 175, 55, 0.2);
}

.qfs-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: var(--qfs-radius-card);
    background:
        linear-gradient(145deg, rgba(30, 30, 30, 0.88), rgba(6, 6, 6, 0.94) 62%, rgba(20, 14, 4, 0.86) 100%);
    box-shadow:
        0 28px 72px rgba(0, 0, 0, 0.56),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 0 0 1px rgba(212, 175, 55, 0.06);
    backdrop-filter: blur(18px) saturate(165%);
    -webkit-backdrop-filter: blur(18px) saturate(165%);
}

.qfs-card::before {
    content: "";
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.08) 0%, transparent 66%);
    pointer-events: none;
}

.qfs-card::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 18px;
    pointer-events: none;
    box-shadow:
        inset 0 0 18px rgba(212, 175, 55, 0.04),
        0 0 0 1px rgba(255, 255, 255, 0.02);
}

.qfs-auth-card {
    padding: 20px 32px 32px;
}

.qfs-auth-card-inner {
    position: relative;
    z-index: 1;
}

.qfs-auth-bracket {
    position: absolute;
    width: 58px;
    height: 58px;
    border: 2px solid var(--qfs-accent);
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.55));
}

.qfs-auth-bracket-tl {
    top: -2px;
    left: -2px;
    border-right: 0;
    border-bottom: 0;
    border-top-left-radius: 24px;
}

.qfs-auth-bracket-br {
    right: -2px;
    bottom: -2px;
    border-top: 0;
    border-left: 0;
    border-bottom-right-radius: 24px;
}

.qfs-auth-topline {
    position: absolute;
    top: 0;
    left: 18%;
    right: 18%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--qfs-accent), transparent);
    opacity: 0.72;
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.35);
}

.qfs-auth-emblem {
    position: relative;
    width: min(272px, 70vw);
    height: min(272px, 70vw);
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qfs-auth-emblem-ring,
.qfs-auth-emblem-glow {
    position: absolute;
    border-radius: 999px;
}

.qfs-auth-emblem-ring {
    display: none;
}

.qfs-auth-emblem-ring-outer {
    animation: qfs-spin 10s linear infinite;
}

.qfs-auth-emblem-ring-inner {
    inset: 16px;
    border-color: rgba(212, 175, 55, 0.14);
    animation: qfs-spin-reverse 15s linear infinite;
}

.qfs-auth-emblem-glow {
    inset: 4px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.26) 0%, rgba(212, 175, 55, 0.11) 40%, rgba(212, 175, 55, 0) 72%);
    filter: blur(28px);
}

.qfs-auth-emblem-image {
    position: relative;
    z-index: 1;
    width: 126%;
    height: 132%;
    object-fit: contain;
    transform: scale(1);
    filter: drop-shadow(0 0 26px rgba(212, 175, 55, 0.22));
}

.qfs-stack-24 > * + * {
    margin-top: var(--qfs-space-24);
}

.qfs-stack-16 > * + * {
    margin-top: var(--qfs-space-16);
}

.qfs-panel-title {
    margin: 0;
    color: var(--qfs-text-strong);
    font-family: var(--qfs-auth-font-body);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.qfs-panel-copy {
    margin: 0;
    color: var(--qfs-text-muted);
    font-family: var(--qfs-auth-font-body);
    font-size: 16px;
    line-height: 1.5;
}

.qfs-panel-copy-hero {
    display: block;
    width: 100%;
    max-width: none;
    color: #fbf6ea;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    text-wrap: pretty;
    text-shadow: 0 0 14px rgba(212, 175, 55, 0.08);
}

.qfs-field-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.qfs-pin-row {
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.qfs-pin-input {
    width: 100%;
    min-width: 0;
    height: 56px;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: var(--qfs-radius-input);
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    font-family: var(--qfs-auth-font-body);
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s ease, box-shadow 0.3s ease;
}

.qfs-pin-input:focus,
.qfs-pin-input:active,
.qfs-pin-input.is-filled {
    outline: 0;
    border-color: var(--qfs-accent);
    box-shadow:
        0 0 20px rgba(212, 175, 55, 0.4),
        inset 0 0 10px rgba(212, 175, 55, 0.1);
    transform: scale(1.05);
}

.qfs-pin-input:-webkit-autofill,
.qfs-pin-input:-webkit-autofill:hover,
.qfs-pin-input:-webkit-autofill:focus,
.qfs-pin-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.4) inset !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff;
    transition: background-color 9999s ease-out 0s;
}

.qfs-alert {
    border: 1px solid rgba(255, 179, 179, 0.35);
    border-radius: var(--qfs-radius-alert);
    background: var(--qfs-error-bg);
    color: var(--qfs-error-text);
    padding: 12px 16px;
    font-family: var(--qfs-auth-font-body);
    font-size: 15px;
    line-height: 1.4;
}

.qfs-auth-support-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.qfs-check-row {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.qfs-check-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qfs-check-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.qfs-check-box {
    width: 18px;
    height: 18px;
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.32);
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.qfs-check-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.qfs-check-icon svg {
    width: 13px;
    height: 13px;
    stroke: var(--qfs-accent-strong);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
}

.qfs-check-input:checked + .qfs-check-box {
    border-color: var(--qfs-accent);
    background: rgba(212, 175, 55, 0.14);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.16);
}

.qfs-check-input:checked ~ .qfs-check-icon {
    opacity: 1;
}

.qfs-check-label {
    color: rgba(255, 255, 255, 0.76);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.qfs-button-primary {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 14px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #0f0f0f 0%, #2a2208 50%, #d4af37 100%);
    color: var(--qfs-text-strong);
    box-shadow: var(--qfs-shadow-button);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.qfs-button-primary::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    transition: left 0.5s ease;
}

.qfs-button-primary:hover::after {
    left: 100%;
}

.qfs-button-primary:active {
    transform: scale(0.985);
}

.qfs-button-primary.is-loading {
    filter: brightness(1.02);
}

.qfs-button-primary[disabled] {
    cursor: wait;
}

.qfs-button-content,
.qfs-button-loader {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.qfs-button-copy {
    font-family: var(--qfs-auth-font-body);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.qfs-button-arrow {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    transition: transform 0.2s ease;
}

.qfs-button-primary:hover .qfs-button-arrow {
    transform: translateX(4px);
}

.qfs-button-loader {
    display: none;
}

.qfs-button-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #ffffff;
    border-radius: 999px;
    animation: qfs-loader-spin 0.85s linear infinite;
}

.qfs-button-primary.is-loading .qfs-button-content {
    display: none;
}

.qfs-button-primary.is-loading .qfs-button-loader {
    display: inline-flex;
}

.qfs-auth-footer {
    margin: 24px 0 0;
    text-align: center;
    color: #5b5b5b;
    font-family: var(--qfs-auth-font-body);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

@keyframes qfs-spin {
    from {
        transform: rotate(0deg);
    }

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

@keyframes qfs-spin-reverse {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0deg);
    }
}

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

@keyframes qfs-mesh-drift {
    0% {
        transform: perspective(1000px) rotateX(64deg) translate3d(-1.5%, 0, -100px);
    }

    50% {
        transform: perspective(1000px) rotateX(64deg) translate3d(1.5%, -1.5%, -100px);
    }

    100% {
        transform: perspective(1000px) rotateX(64deg) translate3d(-1.5%, 0, -100px);
    }
}

@media (max-width: 575.98px) {
    .qfs-auth-page {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .qfs-auth-main {
        align-items: center;
        min-height: auto;
        padding:
            max(12px, env(safe-area-inset-top))
            14px
            max(18px, env(safe-area-inset-bottom))
            14px;
    }

    .qfs-auth-shell {
        max-width: none;
    }

    .qfs-auth-card {
        padding: 14px 16px 20px;
        border-radius: 22px;
    }

    .qfs-auth-brand {
        margin-bottom: 18px;
    }

    .qfs-auth-brand-row {
        gap: 10px;
    }

    .qfs-auth-brand-line {
        width: 20px;
    }

    .qfs-display-title {
        font-size: 28px;
    }

    .qfs-panel-title {
        font-size: 24px;
    }

    .qfs-panel-copy {
        font-size: 15px;
    }

    .qfs-panel-copy-hero {
        font-size: 20px;
        line-height: 1.25;
    }

    .qfs-pin-row {
        gap: 6px;
    }

    .qfs-pin-input {
        height: 50px;
        font-size: 26px;
        border-radius: 10px;
    }

    .qfs-auth-emblem {
        width: min(248px, 76vw);
        height: min(248px, 76vw);
        margin-bottom: 10px;
    }

    .qfs-button-primary {
        min-height: 54px;
        padding: 14px 18px;
    }

    .qfs-button-copy {
        font-size: 14px;
        letter-spacing: 0.12em;
    }

    .qfs-check-label {
        font-size: 14px;
    }
}

@media (max-width: 389.98px) {
    .qfs-auth-main {
        padding:
            max(10px, env(safe-area-inset-top))
            10px
            max(16px, env(safe-area-inset-bottom))
            10px;
    }

    .qfs-auth-card {
        padding: 12px 12px 18px;
    }

    .qfs-eyebrow {
        letter-spacing: 0.28em;
    }

    .qfs-display-title {
        font-size: 24px;
    }

    .qfs-panel-copy-hero {
        font-size: 18px;
    }

    .qfs-pin-row {
        gap: 5px;
    }

    .qfs-pin-input {
        height: 46px;
        font-size: 22px;
    }

    .qfs-auth-emblem {
        width: min(224px, 78vw);
        height: min(224px, 78vw);
    }

    .qfs-button-copy {
        font-size: 13px;
    }
}
