/* ============================================================
   NQM AGENCY — Auth Pages CSS
   Style giống landing: Meteor · Cyber canvas · Orbs · Glass
   ============================================================ */

/* ============================================================
   1. RESET + BASE
   ============================================================ */
.auth-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   2. BACKGROUND LAYERS
   ============================================================ */

/* Cyber 3D Canvas */
.auth-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: .6;
}

/* Animated gradient orbs */
.auth-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    animation: auth-orb-float 14s ease-in-out infinite alternate;
}

.auth-orb-1 {
    width: 500px;
    height: 500px;
    top: -180px;
    right: -120px;
    background: radial-gradient(circle,
        color-mix(in srgb, var(--accent) 16%, transparent),
        transparent 65%);
    animation-delay: 0s;
}

.auth-orb-2 {
    width: 420px;
    height: 420px;
    bottom: -150px;
    left: -100px;
    background: radial-gradient(circle,
        color-mix(in srgb, var(--info) 12%, transparent),
        transparent 65%);
    animation-delay: -7s;
    animation-duration: 18s;
}

.auth-orb-3 {
    width: 380px;
    height: 380px;
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle,
        color-mix(in srgb, var(--accent) 8%, transparent),
        transparent 65%);
    animation-delay: -3s;
    animation-duration: 20s;
    opacity: .6;
}

@keyframes auth-orb-float {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(30px, -20px) scale(1.08); }
    100% { transform: translate(-20px, 20px) scale(.95); }
}

/* ============================================================
   3. LAYOUT
   ============================================================ */
.auth-scene {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 90px 20px 60px;
}

.auth-wrap {
    width: 100%;
    max-width: 460px;
    position: relative;
}

/* ============================================================
   4. BRAND BAR (top)
   ============================================================ */
.auth-brand-bar {
    position: absolute;
    top: 24px;
    left: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    z-index: 100;
    transition: opacity .2s ease;
}
.auth-brand-bar:hover { opacity: .8; }

.auth-brand-bar img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 8px;
}

.auth-brand-bar span {
    font: 800 14px var(--sans);
    letter-spacing: -.01em;
}
.auth-brand-bar span strong { color: var(--accent); }

/* ============================================================
   5. THEME TOGGLE (top-right)
   ============================================================ */
.auth-theme {
    position: absolute;
    top: 20px;
    right: 24px;
    z-index: 100;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: border-color .2s ease, color .2s ease, transform .15s ease;
}
.auth-theme:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}
.auth-theme:active { transform: scale(.94); }
.auth-theme svg { width: 17px; height: 17px; stroke: currentColor; }

/* ============================================================
   6. AUTH CARD (Glass)
   ============================================================ */
.auth-card {
    position: relative;
    width: 100%;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xl);
    padding: 40px 38px 34px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, .45),
        0 0 60px color-mix(in srgb, var(--accent) 5%, transparent);
    animation: auth-card-in .6s cubic-bezier(.2, .8, .3, 1);
    overflow: hidden;
    isolation: isolate;
}

/* Gradient border shine */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        color-mix(in srgb, var(--accent) 50%, transparent),
        transparent);
    z-index: 1;
}

/* Corner glow */
.auth-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle,
        color-mix(in srgb, var(--accent) 8%, transparent),
        transparent 65%);
    pointer-events: none;
    z-index: 0;
}

@keyframes auth-card-in {
    from {
        opacity: 0;
        transform: translateY(24px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================================
   7. HEADER
   ============================================================ */
.auth-head {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 18px;
}

.auth-logo {
    width: 68px;
    height: 68px;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 2;
    animation: auth-logo-pulse 3s ease-in-out infinite;
}

.auth-logo-wrap::before {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 1px dashed color-mix(in srgb, var(--accent) 30%, transparent);
    animation: auth-logo-ring 12s linear infinite;
    z-index: 1;
}

.auth-logo-wrap::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle,
        color-mix(in srgb, var(--accent) 15%, transparent),
        transparent 70%);
    filter: blur(12px);
    z-index: 0;
    animation: auth-logo-glow 3s ease-in-out infinite;
}

@keyframes auth-logo-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.04); }
}

@keyframes auth-logo-ring {
    to { transform: rotate(360deg); }
}

@keyframes auth-logo-glow {
    0%, 100% { opacity: .5; }
    50%      { opacity: 1; }
}

/* Eyebrow chip */
.auth-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font: 700 10.5px var(--mono);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    background: color-mix(in srgb, var(--accent) 6%, transparent);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 14px;
    margin-bottom: 16px;
}
.auth-chip svg {
    width: 11px;
    height: 11px;
    stroke: currentColor;
    color: var(--accent);
}
.auth-chip .auth-chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent);
    animation: auth-chip-pulse 2s ease-in-out infinite;
}

@keyframes auth-chip-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .35; transform: scale(.8); }
}

/* Title with gradient */
.auth-head h1 {
    font-size: clamp(24px, 3.2vw, 30px);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.15;
    color: var(--text);
    margin-bottom: 10px;
}

.auth-head h1 span {
    background: linear-gradient(90deg,
        var(--accent),
        color-mix(in srgb, var(--accent) 60%, var(--text)),
        var(--accent));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: auth-text-shimmer 5s ease-in-out infinite;
}

@keyframes auth-text-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

.auth-head p {
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================
   8. ALERT
   ============================================================ */
.auth-alert {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 18px;
    border: 1px solid;
    line-height: 1.5;
    animation: auth-alert-shake .4s ease;
}
.auth-alert svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    flex-shrink: 0;
    margin-top: 1px;
}
.auth-alert.error {
    background: var(--danger-bg);
    border-color: rgba(239, 68, 68, .3);
    color: #f87171;
}
.auth-alert.success {
    background: var(--success-bg);
    border-color: rgba(34, 197, 94, .3);
    color: #4ade80;
}
@keyframes auth-alert-shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

/* ============================================================
   9. FORM
   ============================================================ */
.auth-form {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-field label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .01em;
}
.auth-field label svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    opacity: .7;
}
.auth-field label .auth-req {
    color: var(--danger);
}
.auth-field label .auth-opt {
    color: var(--muted);
    font-weight: 500;
    font-size: 11.5px;
}

/* Input wrapper with icon */
.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    stroke: currentColor;
    color: var(--muted);
    pointer-events: none;
    transition: color .2s ease;
    z-index: 2;
}

.auth-field input {
    width: 100%;
    padding: 14px 16px 14px 46px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-2) 90%, transparent);
    color: var(--text);
    font: 13.5px var(--sans);
    border-radius: 12px;
    outline: none;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.auth-field input:focus {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--surface-3) 90%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
    outline: none;
}

.auth-field input:focus ~ .auth-input-icon,
.auth-input-wrap:focus-within .auth-input-icon {
    color: var(--accent);
}

.auth-field input::placeholder {
    color: var(--muted);
    opacity: .85;
}

/* Password field */
.auth-pass-wrap input {
    padding-right: 46px;
}

.auth-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 8px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: color .2s ease, background .2s ease;
    z-index: 3;
}
.auth-eye:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.auth-eye svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
}

/* Password strength meter */
.pw-meter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}
.pw-meter-track {
    flex: 1;
    height: 5px;
    background: var(--surface-3);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.pw-meter-fill {
    display: block;
    height: 100%;
    width: 0;
    background: var(--line);
    border-radius: inherit;
    transition: width .3s cubic-bezier(.2, .8, .3, 1), background .3s ease;
    position: relative;
}
.pw-meter-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, .3),
        transparent);
    animation: pw-shimmer 2s ease-in-out infinite;
    opacity: 0;
}
.pw-meter.lvl-1 .pw-meter-fill::after,
.pw-meter.lvl-2 .pw-meter-fill::after,
.pw-meter.lvl-3 .pw-meter-fill::after,
.pw-meter.lvl-4 .pw-meter-fill::after {
    opacity: 1;
}
@keyframes pw-shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.pw-meter-label {
    font: 700 10px var(--mono);
    letter-spacing: .05em;
    white-space: nowrap;
    min-width: 66px;
    text-align: right;
    color: var(--muted);
    transition: color .3s ease;
}
.pw-meter.lvl-1 .pw-meter-fill { width: 25%;  background: #e8283a; }
.pw-meter.lvl-1 .pw-meter-label { color: #e8283a; }
.pw-meter.lvl-2 .pw-meter-fill { width: 55%;  background: #e8b423; }
.pw-meter.lvl-2 .pw-meter-label { color: #e8b423; }
.pw-meter.lvl-3 .pw-meter-fill { width: 80%;  background: #3fbf6a; }
.pw-meter.lvl-3 .pw-meter-label { color: #3fbf6a; }
.pw-meter.lvl-4 .pw-meter-fill { width: 100%; background: #16a34a; }
.pw-meter.lvl-4 .pw-meter-label { color: #16a34a; }

/* Terms */
.auth-terms {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.55;
    padding: 4px 0;
    cursor: pointer;
}
.auth-terms input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    border: 1.5px solid var(--line-strong);
    background: var(--surface-2);
    border-radius: 5px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: .2s ease;
}
.auth-terms input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}
.auth-terms input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a0a0c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12l5 5L20 7'/></svg>") center/12px no-repeat;
}
.auth-terms a {
    color: var(--text);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color .2s ease;
}
.auth-terms a:hover {
    color: var(--accent);
}

/* Submit button */
.auth-submit {
    position: relative;
    width: 100%;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    background: var(--accent);
    color: var(--accent-ink);
    border: 0;
    border-radius: 12px;
    font: 800 14px var(--sans);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
    margin-top: 8px;
    overflow: hidden;
    isolation: isolate;
}

.auth-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg,
        transparent 30%,
        rgba(255, 255, 255, .35) 50%,
        transparent 70%);
    transform: translateX(-100%);
    transition: transform .6s ease;
    z-index: 0;
}

.auth-submit:hover::before {
    transform: translateX(100%);
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px color-mix(in srgb, var(--accent) 30%, transparent);
}

.auth-submit:active {
    transform: translateY(0);
}

.auth-submit svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    position: relative;
    z-index: 1;
}

.auth-submit span {
    position: relative;
    z-index: 1;
}

/* ============================================================
   10. DIVIDER
   ============================================================ */
.auth-divider {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0 18px;
    font: 700 10.5px var(--mono);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted-2);
    z-index: 1;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

/* ============================================================
   11. FOOTER SWITCH
   ============================================================ */
.auth-foot {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    margin: 0;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.auth-foot a {
    color: var(--text);
    font-weight: 800;
    text-decoration: none;
    position: relative;
    transition: color .2s ease;
}
.auth-foot a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    height: 1.5px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .3s cubic-bezier(.2, .8, .3, 1);
}
.auth-foot a:hover {
    color: var(--accent);
}
.auth-foot a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Back to home */
.auth-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
    font-size: 12.5px;
    color: var(--muted);
    text-decoration: none;
    transition: color .2s ease, gap .3s ease;
    position: relative;
    z-index: 1;
    width: 100%;
}
.auth-back:hover {
    color: var(--text);
    gap: 10px;
}
.auth-back svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
}

/* ============================================================
   12. METEOR OVERRIDE
   ============================================================ */
.auth-body .meteor-layer {
    position: fixed;
    z-index: 0;
}

/* ============================================================
   13. PAGINATION (register progress)
   ============================================================ */
.auth-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 22px;
    position: relative;
    z-index: 1;
}
.auth-step {
    width: 32px;
    height: 4px;
    border-radius: 999px;
    background: var(--line);
    transition: background .3s ease, width .3s ease;
}
.auth-step.is-active {
    background: var(--accent);
    width: 48px;
}
.auth-step.is-done {
    background: var(--accent);
    opacity: .5;
}

/* ============================================================
   14. RESPONSIVE
   ============================================================ */
@media (max-width: 520px) {
    .auth-scene {
        padding: 76px 16px 40px;
    }
    .auth-card {
        padding: 32px 24px 28px;
        border-radius: var(--radius-lg);
    }
    .auth-head h1 {
        font-size: 22px;
    }
    .auth-logo {
        width: 56px;
        height: 56px;
    }
    .auth-logo-wrap::before {
        inset: -8px;
    }
    .auth-brand-bar {
        top: 18px;
        left: 16px;
    }
    .auth-brand-bar img {
        width: 28px;
        height: 28px;
    }
    .auth-brand-bar span {
        font-size: 13px;
    }
    .auth-theme {
        top: 14px;
        right: 16px;
        width: 38px;
        height: 38px;
    }
    .auth-field input {
        padding: 13px 14px 13px 42px;
        font-size: 13px;
    }
    .auth-input-icon {
        left: 14px;
        width: 16px;
        height: 16px;
    }
    .auth-submit {
        height: 48px;
        font-size: 13px;
    }
    .auth-orb {
        opacity: .6;
    }
}

/* ============================================================
   15. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .auth-orb,
    .auth-logo,
    .auth-logo-wrap::before,
    .auth-logo-wrap::after,
    .auth-head h1 span,
    .auth-submit::before,
    .pw-meter-fill::after,
    .auth-chip .auth-chip-dot {
        animation: none !important;
    }
}