/* ═══════════════════════════════════════════════════════════════
   DexxNet — Premium Auth (Unique Layout)
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #04060c;
    color: #e0e4ec;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── Canvas ── */
#terrain {
    position: fixed; inset: 0;
    width: 100%; height: 100%;
    z-index: 0;
}

.auth-noise {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
}

/* ── Watermark ── */
.auth-watermark {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) rotate(-8deg);
    font-size: clamp(80px, 14vw, 200px);
    font-weight: 700;
    letter-spacing: -6px;
    color: rgba(139,92,246,0.025);
    white-space: nowrap;
    pointer-events: none;
    z-index: 0;
    user-select: none;
    font-family: 'Space Grotesk', sans-serif;
}

/* ── Layout ── */
.auth-layout {
    position: relative; z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100vh;
    overflow: hidden;
}

/* ── Left Panel (Branding) ── */
.auth-left {
    display: flex;
    align-items: flex-end;
    padding: 48px 56px;
    position: relative;
}
.auth-left::after {
    content: '';
    position: absolute;
    right: 0; top: 10%; bottom: 10%;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(139,92,246,0.15), transparent);
}
.auth-left-inner {
    max-width: 420px;
}

.auth-brand {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 48px;
}
.auth-brand-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: rgba(139,92,246,0.08);
    border: 1px solid rgba(139,92,246,0.15);
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
.auth-brand-icon::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,0.06), transparent);
}
.auth-brand-icon svg {
    width: 18px; height: 18px;
    color: rgba(139,92,246,0.8);
    position: relative; z-index: 1;
}
.auth-brand-name {
    font-size: 16px; font-weight: 600;
    letter-spacing: -0.3px;
    color: rgba(255,255,255,0.7);
}

.auth-headline {
    margin-bottom: 16px;
    line-height: 1;
}
.auth-headline-line {
    display: block;
    font-size: clamp(40px, 5vw, 64px);
    font-weight: 700;
    letter-spacing: -2px;
    color: #e8ecf4;
}
.auth-headline-line.accent {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-tagline {
    font-size: 15px;
    color: rgba(255,255,255,0.35);
    line-height: 1.6;
    margin-bottom: 32px;
}

.auth-status {
    display: flex; align-items: center; gap: 8px;
}
.auth-status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px rgba(34,197,94,0.4);
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 8px rgba(34,197,94,0.4); }
    50% { box-shadow: 0 0 16px rgba(34,197,94,0.6); }
}
.auth-status-text {
    font-size: 12px;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.3px;
}

/* ── Right Panel (Form) ── */
.auth-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.auth-panel {
    width: 100%;
    max-width: 380px;
    animation: panel-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}
@keyframes panel-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 36px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.auth-panel-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.4);
}
.auth-panel-step {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: rgba(255,255,255,0.15);
}

/* ── Form ── */
.auth-field {
    margin-bottom: 20px;
    animation: field-slide 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.auth-field:nth-child(1) { animation-delay: 0.2s; }
.auth-field:nth-child(2) { animation-delay: 0.3s; }
@keyframes field-slide {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}

.auth-field-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.25);
    margin-bottom: 10px;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.auth-input-icon {
    position: absolute;
    left: 14px;
    width: 16px; height: 16px;
    color: rgba(255,255,255,0.15);
    pointer-events: none;
    transition: color 0.3s ease;
}
.auth-input {
    width: 100%;
    padding: 14px 16px 14px 42px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    color: #e0e4ec;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.auth-input::placeholder {
    color: rgba(255,255,255,0.15);
    font-weight: 300;
}
.auth-input:focus {
    outline: none;
    border-color: rgba(139,92,246,0.35);
    background: rgba(255,255,255,0.03);
}
.auth-input:focus + .auth-input-icon,
.auth-input-wrap:focus-within .auth-input-icon {
    color: rgba(139,92,246,0.6);
}

/* Error */
.form-error {
    padding: 10px 14px;
    background: rgba(239,68,68,0.05);
    border: 1px solid rgba(239,68,68,0.1);
    border-radius: 8px;
    color: #f43f5e;
    font-size: 13px;
    margin-bottom: 16px;
    animation: field-slide 0.3s ease both;
}

/* ── Submit Button ── */
.auth-submit {
    width: 100%;
    padding: 14px 24px;
    margin-top: 8px;
    background: rgba(139,92,246,0.1);
    border: 1px solid rgba(139,92,246,0.2);
    border-radius: 10px;
    color: rgba(139,92,246,0.9);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.auth-submit::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}
.auth-submit:hover {
    border-color: rgba(139,92,246,0.4);
    color: white;
    box-shadow: 0 4px 24px rgba(139,92,246,0.15);
}
.auth-submit:hover::before {
    opacity: 1;
}
.auth-submit-text,
.auth-submit-arrow {
    position: relative; z-index: 1;
}
.auth-submit-arrow {
    width: 16px; height: 16px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.auth-submit:hover .auth-submit-arrow {
    transform: translateX(4px);
}
.auth-submit:active {
    transform: scale(0.98);
}
.auth-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Loading state */
.auth-submit.loading {
    pointer-events: none;
}
.auth-submit.loading .auth-submit-text {
    font-size: 0;
}
.auth-submit.loading::after {
    content: '';
    position: relative; z-index: 1;
    width: 18px; height: 18px;
    border: 2px solid rgba(139,92,246,0.2);
    border-top-color: rgba(139,92,246,0.8);
    border-radius: 50%;
    animation: auth-spin 0.6s linear infinite;
}
@keyframes auth-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Success state */
.auth-submit.success {
    background: rgba(34,197,94,0.1);
    border-color: rgba(34,197,94,0.25);
    color: #10b981;
    pointer-events: none;
}
.auth-submit.success::before { opacity: 0; }
.auth-submit.success .auth-submit-arrow { display: none; }

/* ── Footer ── */
.auth-panel-footer {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.04);
    font-size: 13px;
    color: rgba(255,255,255,0.25);
    text-align: center;
}
.auth-panel-footer a {
    color: rgba(139,92,246,0.8);
    text-decoration: none;
    font-weight: 500;
    margin-left: 4px;
    transition: color 0.2s ease;
}
.auth-panel-footer a:hover {
    color: rgba(139,92,246,1);
}

/* ── Discord Button ── */
.auth-discord {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    background: #5865F2;
    border: 1px solid #5865F2;
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    margin-bottom: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: authFadeUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.15s both;
}
.auth-discord svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.auth-discord:hover {
    background: #4752C4;
    border-color: #4752C4;
    box-shadow: 0 4px 24px rgba(88, 101, 242, 0.35);
    transform: translateY(-2px);
}
.auth-discord:active {
    transform: translateY(0) scale(0.98);
}

/* ── Divider ── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0;
    animation: authFadeUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.25s both;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
}
.auth-divider span {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.2);
}

/* ═══════════════════════════════════════════════════════════════
   SIGNUP PAGE
   ═══════════════════════════════════════════════════════════════ */

.auth-key-display {
    display: flex; gap: 8px; margin-bottom: 18px;
}
.auth-key-display .auth-input {
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px; font-weight: 500;
    letter-spacing: 0.5px; text-align: center;
    padding-left: 16px;
    background: rgba(34,197,94,0.02);
    border-color: rgba(34,197,94,0.12);
    color: #10b981;
}
.auth-key-warning {
    padding: 14px 16px;
    background: rgba(239,68,68,0.03);
    border: 1px solid rgba(239,68,68,0.08);
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px;
}
.auth-key-warning svg { flex-shrink: 0; }
.auth-key-warning p {
    font-size: 13px; color: rgba(239,68,68,0.8);
    font-weight: 500; margin: 0; line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .auth-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    .auth-left {
        padding: 32px 28px 24px;
        align-items: flex-start;
    }
    .auth-left::after {
        display: none;
    }
    .auth-left-inner {
        max-width: 100%;
    }
    .auth-headline-line {
        font-size: 36px;
    }
    .auth-headline-line.accent {
        font-size: 36px;
    }
    .auth-right {
        padding: 0 28px 32px;
        align-items: flex-start;
    }
    .auth-watermark {
        font-size: 60px;
        letter-spacing: -3px;
    }
}

@media (max-width: 480px) {
    .auth-left { padding: 24px 20px 16px; }
    .auth-right { padding: 0 20px 24px; }
    .auth-headline-line { font-size: 28px; letter-spacing: -1px; }
    .auth-headline-line.accent { font-size: 28px; }
    .auth-brand { margin-bottom: 28px; }
    .auth-tagline { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   ENTRANCE ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

@keyframes authLeftSlideIn {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes authRightSlideIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes authFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-left {
    animation: authLeftSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both;
}

.auth-right {
    animation: authRightSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

.auth-headline-line {
    animation: authFadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.auth-headline-line:nth-child(1) { animation-delay: 0.3s; }
.auth-headline-line:nth-child(2) { animation-delay: 0.4s; }

.auth-tagline {
    animation: authFadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.5s both;
}

.auth-status {
    animation: authFadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.6s both;
}

.auth-panel {
    animation: authFadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

.auth-field {
    animation: authFadeUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.auth-field:nth-child(1) { animation-delay: 0.5s; }
.auth-field:nth-child(2) { animation-delay: 0.6s; }
.auth-field:nth-child(3) { animation-delay: 0.7s; }

.auth-submit {
    animation: authFadeUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.8s both;
}

/* Enhanced focus states */
.auth-input:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(139,92,246,0.15);
}

/* Button hover glow */
.auth-submit:hover {
    box-shadow: 0 4px 24px rgba(139,92,246,0.25);
    transform: translateY(-2px);
}

.auth-submit:active {
    transform: translateY(0) scale(0.98) !important;
}

/* Brand icon bounce */
.auth-brand-icon {
    animation: authFadeUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

/* Status dot pulse */
.auth-status-dot {
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}
