/* Nudget - Shared Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #050505;
    --bg-subtle: #0a0a0a;
    --bg-card: #111111;
    --border: #1a1a1a;
    --border-hover: #2a2a2a;
    --text: #fafafa;
    --text-secondary: #a1a1a1;
    --text-muted: #525252;
    --accent: #22c55e;
    --accent-hover: #16a34a;
    --accent-glow: rgba(34, 197, 94, 0.15);
    --error: #ef4444;
    --warning: #f59e0b;
}

body {
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    font-size: 14px;
    overflow-x: hidden;
}

/* Subtle grid background */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.container-sm {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* Logo */
.logo {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--text);
}

.logo-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    margin-left: 2px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.9); }
}

/* Typography */
h1 {
    font-size: 44px;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -2px;
}

h2 {
    font-size: 28px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -1px;
}

h3 {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
}

.highlight {
    color: var(--accent);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-primary:disabled {
    background: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    background: var(--bg-subtle);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
}

.btn-ghost:hover {
    color: var(--text);
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    font-family: inherit;
    font-size: 16px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    color: var(--text);
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input.error {
    border-color: var(--error);
}

.form-error {
    color: var(--error);
    font-size: 13px;
    margin-top: 8px;
}

.form-hint {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 8px;
}

/* Cards */
.card {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    padding: 32px;
    position: relative;
}

.card-glow {
    overflow: hidden;
}

.card-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.5;
}

/* Status Messages */
.status {
    padding: 16px;
    border: 1px solid;
    margin-bottom: 20px;
}

.status-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--accent);
}

.status-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.status-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    color: var(--text-secondary);
}

/* Header */
.header {
    padding: 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Footer */
.footer {
    padding: 24px 0;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: auto;
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 24px;
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--accent);
}

/* Page Layout */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-center {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

/* Checkbox/Toggle */
.toggle-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.toggle-group:last-child {
    border-bottom: none;
}

.toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text);
    transition: 0.3s;
    border-radius: 50%;
}

.toggle input:checked + .toggle-slider {
    background-color: var(--accent);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-label {
    flex: 1;
}

.toggle-title {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 2px;
}

.toggle-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Select Dropdown */
.form-select {
    width: 100%;
    padding: 14px 16px;
    font-family: inherit;
    font-size: 14px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23525252' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.form-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 32px;
    }

    h2 {
        font-size: 24px;
    }

    .footer {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .footer a {
        margin: 0 12px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.hidden { display: none !important; }
