:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --bg-card: #2a2a2a;
    --bg-input: #333333;
    --text-primary: #e5e5e5;
    --text-secondary: #999999;
    --accent: #c44545;
    --accent-hover: #d45858;
    --accent-glow: rgba(196, 69, 69, 0.3);
    --border: #3d3d3d;
    --success: #4caf50;
    --warning: #ff9800;
    --error: #f44336;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
}

/* Auth Layout */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 10%, #2a2a2a 0%, #0f0f0f 100%);
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-2px);
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--accent), #8b3030);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    font-weight: bold;
    box-shadow: 0 8px 16px rgba(196, 69, 69, 0.2);
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 18px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.form-group select {
    padding: 12px 16px;
}

.form-group textarea {
    padding: 12px 16px;
    resize: vertical;
    min-height: 100px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: #3a3a3a;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent), #8b3030);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), #9e3535);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(196, 69, 69, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

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

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

/* Messages */
.message {
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    text-align: center;
}

.message-error {
    background: rgba(244, 67, 54, 0.1);
    color: var(--error);
    border-left: 3px solid var(--error);
}

.message-success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success);
    border-left: 3px solid var(--success);
}

/* Links */
.auth-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.auth-link:hover {
    color: var(--accent);
}

/* Dashboard Layout */
.dashboard-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.nav-back {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.nav-back:hover {
    background: var(--bg-input);
    color: var(--accent);
}

.user-menu {
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--bg-input);
    transition: all 0.2s;
}

.user-menu:hover {
    background: #3a3a3a;
    color: var(--accent);
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 12px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active,
.modal[style*="display: flex"] {
    display: flex !important;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    border: 1px solid var(--border);
    position: relative;
    margin: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

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

.logout-btn {
    width: 100%;
    margin-top: 16px;
    background: transparent;
    border: 1px solid var(--error);
    color: var(--error);
}

.logout-btn:hover {
    background: var(--error);
    color: white;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    .top-bar {
        padding: 12px 20px;
    }
    
    .modal-content {
        padding: 24px;
        margin: 16px;
        width: calc(100% - 32px);
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 32px 24px;
    }
    
    .auth-header h1 {
        font-size: 24px;
    }
    
    .logo {
        width: 52px;
        height: 52px;
        font-size: 26px;
    }
}