/* ============================================
   macher.one App — CSS
   Basiert auf STYLE-GUIDE.md
   ============================================ */

/* --- Variables --- */
:root {
    /* Background */
    --bg: #0b0f1a;
    --bg-mid: #0f1525;
    --bg-light: #141c30;

    /* Brand */
    --primary: #7a00df;
    --primary-light: #9b3ff5;
    --primary-glow: rgba(122,0,223,0.15);
    --primary-dark: #1D0C3C;
    --neon: #00ff88;
    --neon-glow: rgba(0,255,136,0.08);
    --accent-warm: #f59e0b;

    /* Text */
    --text: #e8e8f0;
    --text-muted: #8892a8;
    --text-light: #5a6478;

    /* Glass */
    --glass: rgba(255,255,255,0.04);
    --glass-border: rgba(255,255,255,0.07);

    /* Radius */
    --radius-sm: 10px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-pill: 20px;

    /* Status */
    --status-success: #00ff88;
    --status-warning: #f59e0b;
    --status-error: #ff4466;
}

/* --- Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--text);
}

/* --- App Header --- */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(11,15,26,0.80);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--glass-border);
}

.header-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 14px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-decoration: none;
}

.logo-macher {
    background: linear-gradient(135deg, var(--primary-light), var(--neon));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-dot {
    color: var(--neon);
    -webkit-text-fill-color: var(--neon);
}

.logo-one {
    color: var(--text-muted);
    -webkit-text-fill-color: var(--text-muted);
    font-weight: 400;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-user {
    font-size: 14px;
    color: var(--text-muted);
}

.header-logout {
    color: var(--text-light);
    transition: color 0.3s;
    display: flex;
    align-items: center;
}

.header-logout:hover {
    color: var(--status-error);
}

/* --- App Main --- */
.app-main {
    max-width: 1440px;
    margin: 0 auto;
    padding: 88px 32px 40px;
    min-height: calc(100vh - 60px);
}

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

.footer-version {
    color: var(--text-light);
}

/* --- Page Header --- */
.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 700;
    letter-spacing: -0.3px;
}

.page-header p {
    color: var(--text-muted);
    margin-top: 4px;
    font-size: 15px;
}

/* --- Cards --- */
.card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all 0.35s;
    position: relative;
}

.card:hover {
    border-color: rgba(122,0,223,0.25);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.35s;
}

.card:hover::before {
    opacity: 1;
}

/* --- Module Cards (Dashboard) --- */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.module-card {
    cursor: default;
}

.module-card .module-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: var(--primary-glow);
    border: 1px solid rgba(122,0,223,0.12);
    margin-bottom: 16px;
}

.module-card .module-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.module-card .module-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.module-card .module-badge {
    display: inline-block;
    margin-top: 12px;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-weight: 500;
}

.module-badge.badge-beta {
    background: var(--neon-glow);
    border: 1px solid rgba(0,255,136,0.15);
    color: var(--neon);
}

.module-badge.badge-live {
    background: var(--primary-glow);
    border: 1px solid rgba(122,0,223,0.15);
    color: var(--primary-light);
}

.module-card.module-locked {
    opacity: 0.45;
    pointer-events: none;
}

/* --- Stats Bar --- */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

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

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
}

.stat-value.stat-neon {
    color: var(--neon);
}

/* --- Kontingent-Balken --- */
.kontingent {
    margin-bottom: 32px;
}

.kontingent-bar {
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.kontingent-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.kontingent-fill.warn {
    background: linear-gradient(90deg, var(--accent-warm), #f97316);
}

.kontingent-fill.critical {
    background: linear-gradient(90deg, var(--status-error), #ff6688);
}

.kontingent-text {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
}

/* --- Alerts --- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
}

.alert-error {
    background: rgba(255,68,102,0.1);
    border: 1px solid rgba(255,68,102,0.2);
    color: #ff6688;
}

.alert-success {
    background: var(--neon-glow);
    border: 1px solid rgba(0,255,136,0.15);
    color: var(--neon);
}

.alert-info {
    background: var(--primary-glow);
    border: 1px solid rgba(122,0,223,0.15);
    color: var(--primary-light);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 20px rgba(122,0,223,0.3);
}

.btn-primary:hover {
    box-shadow: 0 8px 32px rgba(122,0,223,0.45);
    transform: translateY(-2px);
    color: white;
}

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

.btn-ghost:hover {
    border-color: rgba(122,0,223,0.3);
    color: var(--text);
    background: var(--primary-glow);
}

.btn-full {
    width: 100%;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.25s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(122,0,223,0.4);
    box-shadow: 0 0 0 3px rgba(122,0,223,0.1), 0 0 20px rgba(122,0,223,0.08);
}

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

/* --- Login Page --- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    overflow: hidden;
}

.login-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 24px;
    z-index: 1;
}

.login-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(100px);
}

.glow-purple {
    width: 400px;
    height: 400px;
    background: rgba(122,0,223,0.2);
    top: -100px;
    left: -100px;
    opacity: 0.4;
}

.glow-green {
    width: 300px;
    height: 300px;
    background: rgba(0,255,136,0.1);
    bottom: -80px;
    right: -80px;
    opacity: 0.3;
}

.login-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    position: relative;
}

.login-logo {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 32px;
}

.login-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 12px;
    color: var(--text-light);
}

/* --- Blocked Page --- */
.blocked-card {
    text-align: center;
}

.blocked-icon {
    font-size: 48px;
    margin: 20px 0;
}

.blocked-card h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
}

.blocked-text {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 28px;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto;
}

/* --- Welcome Section --- */
.welcome-section {
    margin-bottom: 40px;
}

.welcome-greeting {
    font-size: clamp(22px, 4vw, 28px);
    font-weight: 700;
    margin-bottom: 4px;
}

.welcome-date {
    color: var(--text-muted);
    font-size: 14px;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .header-inner {
        padding: 12px 16px;
    }

    .header-user {
        display: none;
    }

    .app-main {
        padding: 76px 16px 32px;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 32px 24px;
    }

    .app-footer {
        padding: 20px 16px;
    }
}
