/* ===== SCSD Dienstantritt ===== */

:root {
    --bg-dark: #0a0a0f;
    --bg-card: #111118;
    --bg-card-2: #15151f;
    --bg-input: #1a1a26;
    --bg-input-hover: #1f1f30;
    --accent-gold: #d4a843;
    --accent-gold-light: #e8c46a;
    --accent-gold-dim: rgba(212, 168, 67, 0.12);
    --accent-glow: rgba(212, 168, 67, 0.35);
    --green: #10b981;
    --green-dim: rgba(16, 185, 129, 0.15);
    --red: #ef4444;
    --red-dim: rgba(239, 68, 68, 0.15);
    --discord: #5865F2;
    --discord-hover: #4752c4;
    --text-primary: #f0f2f8;
    --text-secondary: #9ca3b4;
    --text-muted: #5c6478;
    --border: rgba(255, 255, 255, 0.06);
    --border-gold: rgba(212, 168, 67, 0.2);
    --radius: 12px;
    --radius-lg: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    position: relative;
    background-image:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(212, 168, 67, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 50% 100%, rgba(212, 168, 67, 0.025) 0%, transparent 50%);
}

/* Background glows */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(140px);
    animation: glow-drift 14s ease-in-out infinite alternate;
}
.bg-glow-1 {
    width: clamp(280px, 40vw, 600px);
    height: clamp(280px, 40vw, 600px);
    top: -8%; left: -3%;
    background: radial-gradient(circle, rgba(212, 168, 67, 0.07), transparent 70%);
}
.bg-glow-2 {
    width: clamp(200px, 30vw, 500px);
    height: clamp(200px, 30vw, 500px);
    bottom: -8%; right: -3%;
    background: radial-gradient(circle, rgba(212, 168, 67, 0.05), transparent 70%);
    animation-delay: -7s;
}
@keyframes glow-drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(20px, -15px) scale(1.08); }
}

/* Back link */
.back-link {
    position: fixed;
    top: clamp(16px, 2.5vh, 24px);
    left: clamp(16px, 2.5vw, 32px);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    z-index: 10;
}
.back-link:hover {
    color: var(--accent-gold);
    background: rgba(212, 168, 67, 0.08);
    border-color: var(--border-gold);
}
.back-link:hover i { transform: translateX(-3px); }
.back-link i { transition: transform 0.3s ease; font-size: 0.74rem; }

/* Wrapper */
.page-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 4vh, 60px) clamp(16px, 4vw, 48px);
}
.main-wrapper {
    justify-content: flex-start;
    padding-top: clamp(72px, 10vh, 100px);
    max-width: 1280px;
    margin: 0 auto;
}

/* ===== LOGIN screen ===== */
.abmeldung-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: clamp(32px, 5vw, 56px) clamp(24px, 4vw, 52px) clamp(28px, 4vw, 48px);
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 30px 80px -20px rgba(0,0,0,0.55);
    animation: card-enter 0.6s cubic-bezier(.22,.9,.36,1) both;
    position: relative;
}
.abmeldung-card::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 60%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
    opacity: 0.6;
}
@keyframes card-enter {
    0% { opacity: 0; transform: translateY(20px) scale(0.985); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.card-logo { text-align: center; margin-bottom: 12px; }
.card-logo img {
    width: clamp(60px, 8vw, 80px);
    height: clamp(60px, 8vw, 80px);
    filter: drop-shadow(0 0 24px rgba(212,168,67,0.3));
}
.card-title-section { margin-bottom: 28px; }
.card-title-section h1 {
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    color: var(--accent-gold);
    font-weight: 800;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
}
.card-title-section::after {
    content: '';
    display: block;
    width: 40px; height: 2px;
    background: var(--accent-gold);
    margin: 16px auto 0;
    border-radius: 2px;
    opacity: 0.35;
}
.card-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
}
.login-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 24px;
}
.discord-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 52px;
    background: var(--discord);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: var(--radius);
    transition: all 0.25s ease;
    box-shadow: 0 4px 24px -6px rgba(88,101,242,0.4);
}
.discord-btn:hover {
    background: var(--discord-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px -6px rgba(88,101,242,0.55);
}
.discord-btn i { font-size: 1.2rem; }

/* ===== TOP BAR ===== */
.top-bar {
    position: fixed;
    top: clamp(16px, 2.5vh, 24px);
    right: clamp(16px, 2.5vw, 32px);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 999px;
    backdrop-filter: blur(12px);
}
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-gold);
}
.user-name { font-size: 0.85rem; font-weight: 600; }
.user-role { font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.8px; text-transform: uppercase; }
.top-bar-actions { display: flex; gap: 8px; }
.top-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.04);
    backdrop-filter: blur(12px);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s ease;
}
.top-link:hover {
    color: var(--accent-gold);
    border-color: var(--border-gold);
    background: rgba(212,168,67,0.08);
}
.top-link.logout:hover {
    color: var(--red);
    border-color: rgba(239,68,68,0.3);
    background: rgba(239,68,68,0.08);
}
.top-link i { font-size: 0.78rem; }

/* ===== Main grid ===== */
.duty-grid {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 24px;
    margin-top: 24px;
}
.right-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: 0 25px 60px -20px rgba(0,0,0,0.5);
    position: relative;
}
.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    letter-spacing: 0.6px;
}
.card-title i {
    color: var(--accent-gold);
    font-size: 0.85rem;
}

/* ===== Duty card ===== */
.duty-header {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}
.status-pill.active {
    background: var(--green-dim);
    border-color: rgba(16,185,129,0.4);
    color: var(--green);
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.3s;
}
.status-pill.active .status-dot {
    background: var(--green);
    box-shadow: 0 0 12px var(--green);
    animation: dot-pulse 1.5s ease-in-out infinite;
}
@keyframes dot-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.timer-display {
    text-align: center;
    padding: 28px 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.timer-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 12px;
    font-weight: 600;
}
.timer-clock {
    font-family: 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: clamp(2.4rem, 6vw, 3.5rem);
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-primary);
    line-height: 1;
    transition: color 0.4s ease, text-shadow 0.4s ease;
}
.timer-clock.live {
    color: var(--accent-gold);
    text-shadow: 0 0 30px rgba(212,168,67,0.4);
}
.timer-meta {
    margin-top: 12px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Form */
.duty-form { display: flex; flex-direction: column; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-group { margin-bottom: 18px; }
.form-group label {
    display: flex;
    align-items: center;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.form-group label i {
    color: var(--accent-gold);
    margin-right: 7px;
    font-size: 0.72rem;
    opacity: 0.7;
    width: 14px;
    text-align: center;
}
.form-group .optional {
    margin-left: 6px;
    font-weight: 400;
    text-transform: none;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    font-size: 0.7rem;
}
.duty-form input[type="text"] {
    width: 100%;
    height: 46px;
    padding: 0 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
    transition: all 0.25s ease;
}
.duty-form input[type="text"]::placeholder { color: var(--text-muted); }
.duty-form input[type="text"]:hover {
    background: var(--bg-input-hover);
    border-color: rgba(255,255,255,0.12);
}
.duty-form input[type="text"]:focus {
    border-color: var(--accent-gold);
    background: var(--bg-input-hover);
    box-shadow: 0 0 0 3px var(--accent-gold-dim);
}
.duty-form input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Action button */
.action-btn {
    width: 100%;
    height: 54px;
    margin-top: 8px;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.action-btn.start {
    background: linear-gradient(135deg, var(--green), #0e8c64);
    color: #fff;
    box-shadow: 0 4px 24px -6px rgba(16,185,129,0.4);
}
.action-btn.start:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px -6px rgba(16,185,129,0.55);
}
.action-btn.end {
    background: linear-gradient(135deg, var(--red), #b73838);
    color: #fff;
    box-shadow: 0 4px 24px -6px rgba(239,68,68,0.4);
}
.action-btn.end:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px -6px rgba(239,68,68,0.55);
}
.action-btn:active { transform: translateY(0); }
.action-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== Stats card ===== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stat-tile {
    background: var(--bg-card-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: all 0.3s ease;
}
.stat-tile:hover {
    border-color: var(--border-gold);
    transform: translateY(-2px);
}
.stat-tile.highlight {
    background: linear-gradient(135deg, rgba(212,168,67,0.1), rgba(212,168,67,0.03));
    border-color: var(--border-gold);
}
.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 6px;
}
.stat-value {
    font-variant-numeric: tabular-nums;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}
.stat-tile.highlight .stat-value { color: var(--accent-gold); }

/* ===== History ===== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
}
.history-list::-webkit-scrollbar { width: 6px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
}
.history-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.25s ease;
}
.history-item:hover {
    border-color: var(--border-gold);
    background: rgba(212,168,67,0.04);
}
.history-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.history-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.history-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.history-duration {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--accent-gold);
    align-self: center;
    font-size: 0.95rem;
}
.history-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .duty-grid { grid-template-columns: 1fr; }
    .top-bar {
        position: static;
        margin: 0 auto 16px;
        padding-top: 60px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .main-wrapper {
        padding-top: 24px;
    }
}

@media (max-width: 600px) {
    .back-link {
        top: 12px; left: 12px;
        padding: 8px 14px;
        font-size: 0.76rem;
    }
    .card { padding: 22px 18px; }
    .timer-clock { font-size: 2.4rem; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-tile { padding: 12px; }
    .stat-value { font-size: 1rem; }
    .top-bar {
        gap: 8px;
    }
    .top-link {
        padding: 8px 12px;
        font-size: 0.76rem;
    }
    .user-info { padding: 4px 12px 4px 4px; }
    .user-avatar { width: 28px; height: 28px; }
    .user-name { font-size: 0.78rem; }
    .user-role { font-size: 0.62rem; }
}
