/* ─── Design System ────────────────────────────────────────── */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c28;
    --bg-input: #1a1a26;
    --bg-input-focus: #1e1e2c;

    --text-primary: #e8e8f0;
    --text-secondary: #9090a8;
    --text-muted: #606078;
    --text-accent: #a78bfa;

    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --accent-glow: rgba(139, 92, 246, 0.25);
    --accent-soft: rgba(139, 92, 246, 0.08);

    --success: #34d399;
    --success-glow: rgba(52, 211, 153, 0.2);
    --success-bg: rgba(52, 211, 153, 0.06);

    --danger: #f87171;
    --danger-glow: rgba(248, 113, 113, 0.2);

    --warning: #fbbf24;

    --border: rgba(255, 255, 255, 0.06);
    --border-focus: rgba(139, 92, 246, 0.4);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--accent-glow);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* ─── Reset & Base ────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background gradient effect */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(139, 92, 246, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(52, 211, 153, 0.03) 0%, transparent 50%);
    z-index: 0;
    pointer-events: none;
}

/* ─── Layout ──────────────────────────────────────────────── */
.page {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Typography ──────────────────────────────────────────── */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), #6d28d9);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 0 20px var(--accent-glow);
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--text-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 32px;
    line-height: 1.5;
}

h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

/* ─── Badge ───────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-mono);
}

.badge-label {
    background: var(--accent-soft);
    color: var(--text-accent);
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.badge-pending {
    background: rgba(251, 191, 36, 0.08);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.15);
}

.badge-submitted {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.15);
}

/* ─── Form Elements ───────────────────────────────────────── */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-mono);
    transition: all 0.2s ease;
    outline: none;
}

input:focus,
textarea:focus {
    background: var(--bg-input-focus);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: var(--font-sans);
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    box-shadow: var(--shadow-sm), 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), 0 0 30px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-focus);
}

.btn-ghost {
    background: transparent;
    color: var(--text-accent);
    padding: 8px 16px;
}

.btn-ghost:hover {
    background: var(--accent-soft);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* ─── Link output ─────────────────────────────────────────── */
.link-output {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    animation: fadeInUp 0.3s ease-out;
}

.link-output code {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-accent);
    word-break: break-all;
    user-select: all;
}

.link-output .btn-copy {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 12px;
    background: var(--accent-soft);
    color: var(--text-accent);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-sans);
    font-weight: 500;
}

.link-output .btn-copy:hover {
    background: rgba(139, 92, 246, 0.15);
}

/* ─── Success State ───────────────────────────────────────── */
.success-icon {
    width: 64px;
    height: 64px;
    background: var(--success-bg);
    border: 2px solid rgba(52, 211, 153, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 20px;
    box-shadow: 0 0 30px var(--success-glow);
    animation: scaleIn 0.4s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-title {
    text-align: center;
    color: var(--success);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.success-desc {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ─── Error State ─────────────────────────────────────────── */
.error-icon {
    width: 64px;
    height: 64px;
    background: rgba(248, 113, 113, 0.06);
    border: 2px solid rgba(248, 113, 113, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 20px;
    box-shadow: 0 0 30px var(--danger-glow);
}

/* ─── Toast Notification ──────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.toast-success {
    background: rgba(52, 211, 153, 0.15);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.toast-error {
    background: rgba(248, 113, 113, 0.15);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ─── Divider ─────────────────────────────────────────────── */
.divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

/* ─── Info box ────────────────────────────────────────────── */
.info-box {
    background: var(--accent-soft);
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 24px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.info-box .icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.info-box .text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.info-box .text strong {
    color: var(--text-accent);
    font-weight: 600;
}

/* ─── Loading spinner ─────────────────────────────────────── */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── Footer ──────────────────────────────────────────────── */
.footer {
    margin-top: 24px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 520px) {
    .card {
        padding: 28px 20px;
    }
}

/* ─── Toggle visibility ──────────────────────────────────── */
.toggle-vis {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.15s;
}

.toggle-vis:hover {
    color: var(--text-accent);
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    padding-right: 44px;
}