:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-card: #1a1a1a;
    --bg-hover: #232323;
    --text-primary: #a8a8a8;
    --text-secondary: #6b6b6b;
    --text-dim: #404040;
    --accent-soft: #2a2a3e;
    --accent-muted: #3a3a4e;
    --danger-muted: #4a2626;
    --danger-soft: #6a3636;
    --success-muted: #1a2e1a;
    --border: #2a2a2a;
    --shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.auth-container {
    max-width: 380px;
    margin: 80px auto;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 35px;
}

.logo {
    text-align: center;
    margin-bottom: 35px;
}

.logo h1 {
    color: var(--text-secondary);
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.logo p {
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 300;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-muted);
    background: var(--bg-hover);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent-soft);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    background: var(--accent-muted);
    color: #fff;
}

.btn-block {
    width: 100%;
}

.btn-danger {
    background: var(--danger-muted);
    border-color: var(--danger-soft);
}

.btn-danger:hover {
    background: var(--danger-soft);
}

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

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-secondary);
    text-decoration: none;
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 300;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--text-primary);
}

.dashboard {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 30px;
    margin-top: 30px;
}

.dashboard h2 {
    color: var(--text-secondary);
    font-weight: 300;
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.dashboard h3 {
    color: var(--text-secondary);
    font-weight: 300;
    margin: 25px 0 15px 0;
    font-size: 1.1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.stat-card h3 {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 400;
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 200;
    color: var(--text-primary);
}

.crisis-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--danger-muted);
    color: var(--text-primary);
    border: 1px solid var(--danger-soft);
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crisis-button:hover {
    background: var(--danger-soft);
    transform: scale(1.05);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    background: var(--bg-secondary);
    padding: 25px;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
}

.modal-header h2 {
    margin: 0;
    color: var(--text-secondary);
    font-weight: 300;
    font-size: 1.3rem;
}

.modal-body {
    padding: 25px;
}

.modal-body h3 {
    color: var(--text-secondary);
    font-weight: 300;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.modal-body p {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.close-modal:hover {
    color: var(--text-primary);
}

.step {
    display: none;
}

.step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.intensity-scale {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    gap: 8px;
}

.intensity-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.intensity-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.intensity-btn.selected {
    background: var(--accent-soft);
    color: var(--text-primary);
    border-color: var(--accent-muted);
}

.emotion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    margin: 20px 0;
}

.emotion-btn {
    padding: 10px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.emotion-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.emotion-btn.selected {
    background: var(--accent-soft);
    color: var(--text-primary);
    border-color: var(--accent-muted);
}

.textarea-group {
    margin: 20px 0;
}

.textarea-group textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.textarea-group textarea:focus {
    outline: none;
    border-color: var(--accent-muted);
    background: var(--bg-hover);
}

.textarea-group textarea::placeholder {
    color: var(--text-dim);
}

.step-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.progress-bar {
    height: 2px;
    background: var(--border);
    border-radius: 1px;
    margin-top: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-muted);
    transition: width 0.3s ease;
}

.crisis-list {
    margin-top: 20px;
}

.crisis-item {
    background: var(--bg-secondary);
    padding: 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.crisis-item:hover {
    background: var(--bg-hover);
}

.crisis-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 5px 0;
}

.crisis-item strong {
    color: var(--text-primary);
}

.crisis-date {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.crisis-intensity {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent-soft);
    color: var(--text-primary);
    border-radius: var(--radius);
    font-size: 0.8rem;
    border: 1px solid var(--accent-muted);
}

.chart-container {
    position: relative;
    height: 250px;
    margin: 25px 0;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 15px;
    border: 1px solid var(--border);
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    border: 1px solid;
    font-size: 0.9rem;
}

.alert-success {
    background: var(--success-muted);
    color: var(--text-primary);
    border-color: #2a4e2a;
}

.alert-danger {
    background: var(--danger-muted);
    color: var(--text-primary);
    border-color: var(--danger-soft);
}

.link-text {
    text-align: center;
    margin-top: 25px;
    color: var(--text-dim);
    font-size: 0.85rem;
}

.link-text a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.link-text a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-soft);
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .auth-container {
        margin: 40px auto;
        padding: 25px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .crisis-button {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        bottom: 20px;
        right: 20px;
    }
    
    .emotion-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
}