:root {
    /* Color Palette - Soft & Professional */
    --bg-dark: 210, 20%, 98%;
    --card-bg: 0, 0%, 100%;
    --primary: 215, 60%, 50%;
    --primary-glow: 215, 60%, 50%, 0.1;
    --accent: 162, 40%, 45%;
    --accent-glow: 162, 40%, 45%, 0.1;
    --danger: 0, 60%, 50%;
    --text-main: 222, 20%, 25%;
    --text-muted: 215, 10%, 55%;
    --border: 214, 20%, 92%;
    
    /* Effects */
    --glass: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
    --radius-lg: 1rem;
    --radius-md: 0.625rem;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: hsl(var(--bg-dark));
    color: hsl(var(--text-main));
    line-height: 1.5;
    overflow-x: hidden;
}

h1, h2, h3, h4, .btn-premium {
    font-family: 'Outfit', sans-serif;
}

/* Auth Page specific */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
}

.glass-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, hsla(var(--primary), 0.08), transparent 40%),
                radial-gradient(circle at 80% 70%, hsla(var(--accent), 0.05), transparent 40%);
    background-color: hsl(var(--bg-dark));
    z-index: -1;
}

.glassmorphism {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

.auth-card {
    width: 100%;
    max-width: 450px;
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    animation: slideUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

/* Authentication Steps */
.auth-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 0.5rem;
}

.auth-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: hsl(var(--text-muted));
    font-size: 0.75rem;
    transition: all 0.3s;
}

.auth-step.active { color: hsl(var(--primary)); }
.auth-step.completed { color: hsl(var(--accent)); }

.step-dot {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: hsla(var(--bg-dark), 0.5);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.auth-step.active .step-dot { border-color: hsl(var(--primary)); color: hsl(var(--primary)); background: hsla(var(--primary), 0.1); }
.auth-step.completed .step-dot { border-color: hsl(var(--accent)); color: hsl(var(--accent)); background: hsla(var(--accent), 0.1); }

.auth-step-line {
    flex: 1;
    max-width: 40px;
    height: 1px;
    background: var(--border);
    margin-bottom: 1.25rem;
}

/* Step Info & Masked Email */
.step-info { text-align: center; margin-bottom: 1.5rem; }
.step-info p { font-size: 0.875rem; color: hsl(var(--text-muted)); margin-bottom: 1rem; }

.masked-email {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: hsla(var(--primary), 0.05);
    border-radius: var(--radius-md);
    border: 1px solid hsla(var(--primary), 0.1);
    color: hsl(var(--primary));
    font-weight: 500;
    font-size: 0.875rem;
}

/* Code Inputs (Manual) */
.code-inputs {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.code-field {
    width: 100%;
    padding: 1rem !important;
    text-align: center !important;
    letter-spacing: 0.5rem;
    font-weight: 700 !important;
    font-size: 1.5rem !important;
    font-family: 'JetBrains Mono', monospace !important;
}

/* Auth Actions & Footer */
.auth-actions { margin-top: 1.5rem; text-align: center; }
.btn-link { 
    color: hsl(var(--text-muted)); text-decoration: none; font-size: 0.875rem; 
    display: inline-flex; align-items: center; gap: 0.5rem; transition: color 0.2s;
}
.btn-link:hover { color: hsl(var(--primary)); }

.auth-footer { 
    margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); 
    text-align: center; font-size: 0.75rem; color: hsl(var(--text-muted)); 
}

/* Forms & Inputs */
.auth-header { text-align: center; margin-bottom: 2.5rem; }
.auth-logo { margin-bottom: 1.5rem; }
.logo-icon { 
    width: 64px; height: 64px; background: hsla(var(--primary), 0.15); 
    border-radius: 1.25rem; display: flex; align-items: center; justify-content: center;
    margin: 0 auto; border: 1px solid hsla(var(--primary), 0.3);
    color: hsl(var(--primary)); font-size: 1.75rem;
}

.auth-header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.auth-header p { color: hsl(var(--text-muted)); font-weight: 400; font-size: 0.9rem; }

.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.75rem; font-size: 0.875rem; font-weight: 500; color: hsl(var(--text-muted)); }
.input-wrapper { position: relative; }
.input-wrapper input {
    width: 100%; padding: 1rem 1.25rem; background: rgba(255,255,255,0.8); border: 1px solid var(--border);
    border-radius: var(--radius-md); color: hsl(var(--text-main)); font-size: 1rem; transition: all 0.3s;
}

.input-focus-border {
    position: absolute; bottom: 0; left: 50%; width: 0; height: 2px;
    background: hsl(var(--primary)); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}

.input-wrapper input:focus ~ .input-focus-border { width: 100%; }
.input-wrapper input:focus { outline: none; border-color: hsla(var(--primary), 0.5); }

/* Buttons */
.btn-premium {
    width: 100%; padding: 0.875rem; background: hsl(var(--primary));
    border: none; border-radius: var(--radius-md); color: white; font-weight: 600; font-size: 0.95rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.75rem;
    transition: all 0.2s;
}

.btn-small { padding: 0.75rem 1rem; font-size: 0.875rem; }

.btn-premium:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -5px var(--primary-glow); }

/* Dashboard Styles */
.dashboard-page { min-height: 100vh; }

.main-wrapper { display: flex; min-height: 100vh; }
.sidebar { 
    width: 280px; background: hsla(var(--card-bg), 0.8); border-right: 1px solid var(--border); 
    padding: 2rem 1.5rem; display: flex; flex-direction: column;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}

.sidebar-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.logo-icon.small { width: 40px; height: 40px; font-size: 1.25rem; }
.sidebar-header h2 { font-size: 1.5rem; letter-spacing: 2px; color: hsl(var(--text-main)); }

.content-area { flex: 1; padding: 2.5rem; overflow-y: auto; }

.content-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 2rem; }
.header-left h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.25rem; }
.header-left p { color: hsl(var(--text-muted)); font-size: 0.875rem; }

.status-badge {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.5rem 1rem; background: hsla(var(--accent), 0.1);
    border: 1px solid hsla(var(--accent), 0.2); border-radius: 999px;
    color: hsl(var(--accent)); font-size: 0.875rem; font-weight: 600;
}

.dot { width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--accent)); }
.dot.pulse { animation: pulse 2s infinite; }

.nav-menu { margin-top: 1rem; flex: 1; }
.nav-list { list-style: none; }
.sidebar-footer { border-top: 1px solid var(--border); padding-top: 1.5rem; }
.text-danger { color: hsl(var(--danger)) !important; }

.nav-item { margin-bottom: 0.5rem; }
.nav-link { 
    display: flex; align-items: center; gap: 1rem; padding: 0.875rem 1.25rem; 
    border-radius: var(--radius-md); color: hsl(var(--text-muted)); text-decoration: none;
    transition: all 0.2s;
}
.nav-link:hover, .nav-link.active { background: hsla(var(--primary), 0.1); color: hsl(var(--primary)); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin-bottom: 2.5rem; }
.stat-card { padding: 1.5rem; border-radius: var(--radius-lg); background: hsla(var(--card-bg), 0.5); border: 1px solid var(--border); }
.stat-card i { font-size: 1.5rem; color: hsl(var(--primary)); margin-bottom: 1rem; }
.stat-card h3 { font-size: 0.875rem; color: hsl(var(--text-muted)); margin-bottom: 0.25rem; }
.stat-card .value { font-size: 1.5rem; font-weight: 700; }

.dashboard-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.5rem; }
.col-8 { grid-column: span 8; }
.col-4 { grid-column: span 4; }

.card { 
    background: hsla(var(--card-bg), 0.5); border: 1px solid var(--border); 
    border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.5rem;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.card-header h2 { font-size: 1.25rem; font-weight: 700; color: hsl(var(--text-main)); display: flex; align-items: center; gap: 0.75rem; }

/* Forms & Global Inputs */
input[type="text"], 
input[type="password"], 
input[type="number"], 
input[type="email"], 
textarea {
    width: 100%; padding: 0.7rem 0.9rem; background: rgba(255,255,255,0.9); 
    border: 1px solid var(--border); border-radius: var(--radius-md); 
    color: hsl(var(--text-main)); font-size: 0.875rem; transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}
input:focus, textarea:focus { outline: none; border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsla(var(--primary), 0.1); }

.grid-form .form-row { display: flex; gap: 1rem; margin-bottom: 1rem; }
.flex-1 { flex: 1; }

/* Terminal */
.terminal {
    background: #f8fafc; border-radius: 0.75rem; padding: 1.25rem; font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.875rem; min-height: 200px; max-height: 400px; overflow-y: auto; border: 1px solid var(--border);
    color: #334155;
}
.terminal-line { margin-bottom: 0.25rem; }
.terminal-prompt { color: hsl(var(--primary)); margin-right: 0.5rem; }
.terminal-success { color: hsl(var(--accent)); }
.terminal-error { color: hsl(var(--danger)); }

/* Table and Lists */
.table-container { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.data-table th { text-align: left; padding: 1rem; color: hsl(var(--text-muted)); font-weight: 500; font-size: 0.875rem; border-bottom: 1px solid var(--border); }
.data-table td { padding: 1rem; border-bottom: 1px solid var(--border); font-size: 0.875rem; vertical-align: middle; }

.peer-id { display: flex; align-items: center; gap: 0.5rem; }
.key-preview { font-family: 'JetBrains Mono', monospace; opacity: 0.7; }
.transfer-stats { font-size: 0.75rem; opacity: 0.8; display: flex; gap: 0.75rem; }
.transfer-stats i { color: hsl(var(--primary)); }

.endpoint-list { list-style: none; }
.endpoint-list li { 
    display: flex; align-items: center; gap: 1rem; padding: 1rem; 
    background: rgba(255,255,255,0.02); border-radius: var(--radius-md); 
    margin-bottom: 0.75rem; border: 1px solid var(--border);
}
.endpoint-list li i { font-size: 1.25rem; color: hsl(var(--primary)); }
.endpoint-list .name { display: block; font-weight: 600; font-size: 0.875rem; }
.endpoint-list .date { font-size: 0.75rem; color: hsl(var(--text-muted)); }

.badge { padding: 0.25rem 0.625rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: hsla(var(--accent), 0.15); color: hsl(var(--accent)); }

/* Alerts */
.auth-alert { padding: 1rem; border-radius: var(--radius-md); display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; font-size: 0.875rem; }
.auth-alert.error { background: hsla(var(--danger), 0.1); color: hsl(var(--danger)); border: 1px solid hsla(var(--danger), 0.2); }
.auth-alert.success { background: hsla(var(--accent), 0.1); color: hsl(var(--accent)); border: 1px solid hsla(var(--accent), 0.2); }

@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .col-8, .col-4 { grid-column: span 1; }
    .sidebar { display: none; }
}