@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;1,400;1,500&display=swap');

:root {
    --bg-primary: #000000;
    --bg-card: #0a0a0a;
    --bg-card-hover: #111111;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);
    --accent: #A855F7;
    --accent-glow: rgba(168, 85, 247, 0.4);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-card: rgba(255, 255, 255, 0.06);
    --success-bg: rgba(168, 85, 247, 0.15);
    --success-border: rgba(168, 85, 247, 0.3);
    --error-bg: rgba(255, 59, 48, 0.15);
    --error-border: rgba(255, 59, 48, 0.3);
    --error-text: #ff6b6b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    overflow-x: hidden;
    position: relative;
    user-select: none;
}

/* Background Effects */
.auth-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.auth-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center;
    -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

.auth-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(ellipse at center, rgba(168, 85, 247, 0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.auth-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.2), transparent);
}

/* Auth Container */
.auth-container {
    width: 100%;
    max-width: 440px;
    text-align: center;
    position: relative;
    z-index: 10;
}

.auth-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(30, 30, 40, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.auth-tag::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
}

.auth-title {
    font-family: 'Inter', sans-serif;
    font-size: clamp(36px, 6vw, 56px);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -1.5px;
    margin-bottom: 16px;
    color: var(--text-primary);
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.auth-title .accent {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 400;
    color: var(--text-primary);
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

.auth-card {
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid var(--border-card);
    border-radius: 24px;
    padding: 32px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    width: 100%;
    margin-top: 10px;
}

.auth-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0 auto 40px;
    line-height: 1.6;
    max-width: 380px;
    font-weight: 400;
}

/* Form Elements */
.auth-form {
    width: 100%;
}

.auth-input-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 20px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(5px);
}

.auth-input-group:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.auth-input-group input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    padding: 12px 16px;
}

.auth-input-group input::placeholder {
    color: var(--text-muted);
}

.auth-btn {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.auth-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(168, 85, 247, 0.4);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Spinner */
.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Feedback Messages */
#errorMessage,
#successMessage {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 14px;
    display: none;
    text-align: left;
    backdrop-filter: blur(10px);
}

#errorMessage {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}

#successMessage {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--accent);
}

/* Links */
.auth-note {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 24px;
}

.auth-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.auth-link:hover {
    opacity: 0.8;
}

/* Back Link */
.back-link {
    position: absolute;
    top: 32px;
    left: 40px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
}

.back-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.back-link svg {
    width: 16px;
    height: 16px;
}

/* Captcha */
.captcha-section {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

/* Token Display (Register specific) */
.token-display {
    border-color: var(--success-border);
    display: none;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.legal-notice {
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.legal-notice a {
    color: var(--text-secondary);
    text-decoration: underline;
    transition: color 0.2s;
}

.legal-notice a:hover {
    color: var(--accent);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.token-display.show {
    display: block;
}

.token-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

.token-value {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 14px;
    color: var(--accent);
    word-break: break-all;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.token-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.copy-btn,
.proceed-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.proceed-btn {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.proceed-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.copy-btn svg,
.proceed-btn svg {
    width: 16px;
    height: 16px;
}

.copy-btn.copied {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(168, 85, 247, 0.1);
}

/* Media Queries */
@media (max-width: 600px) {
    .back-link {
        top: 20px;
        left: 20px;
        padding: 8px;
    }

    .back-link span {
        display: none;
    }

    .auth-title {
        font-size: 36px;
    }
}

.download-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.download-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.download-btn svg {
    width: 16px;
    height: 16px;
}

.warning-msg {
    font-size: 13px;
    color: #ff9800;
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-msg svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}