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

:root {
    --bg: #0f172a;
    --card: #1e293b;
    --card-hover: #334155;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --input-bg: #0f172a;
    --radius: 12px;
}

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

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

/* Header */
.header {
    text-align: center;
    padding: 40px 0 32px;
}

.header-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

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

.header-note {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 16px;
    line-height: 1.6;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 10px;
    padding: 10px 16px;
    text-align: center;
}

.header-note-link {
    color: #fbbf24;
    font-weight: 700;
    text-decoration: none;
}

.header-note-link:hover {
    text-decoration: underline;
}

.ig-icon {
    width: 14px;
    height: 14px;
    vertical-align: -1px;
    margin-right: 3px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 12px;
}

.badge--info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Cards */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title-icon {
    width: 20px;
    height: 20px;
}

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

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

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    transition: border-color 0.2s;
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder {
    color: #475569;
}

.form-hint {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn--primary {
    background: var(--primary);
    color: white;
}

.btn--primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

.btn--primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

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

.btn--outline:hover {
    background: var(--card-hover);
    color: var(--text);
}

.btn--signup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.25);
    text-decoration: none;
    font-size: 14px;
}

.btn--signup:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
}

.btn-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn--danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn--danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Info box */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.info-box--default {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

.info-box--success {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.info-box--warm {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

.info-box--warm strong {
    color: #fbbf24;
}

.info-box--error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.info-box-icon {
    flex-shrink: 0;
    font-size: 16px;
    line-height: 1.5;
}

/* Status section */
.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.status-item {
    background: var(--input-bg);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.status-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.status-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Dates table */
.dates-list {
    margin-top: 12px;
}

.date-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--input-bg);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.date-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-day {
    font-weight: 600;
    color: var(--text);
    min-width: 80px;
}

.date-time {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
}

.date-places {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

/* Divider */
.divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--input-bg);
    border-radius: 8px;
    padding: 4px;
}

.tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-muted);
    border: none;
    background: none;
    transition: all 0.2s;
}

.tab.active {
    background: var(--card);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.tab:hover:not(.active) {
    color: var(--text);
}

/* Panels */
.panel {
    display: none;
}

.panel.active {
    display: block;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px 0;
    color: #475569;
    font-size: 12px;
}

/* Accordion */
.accordion-item {
    background: var(--input-bg);
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
    gap: 8px;
}

.accordion-header:hover {
    background: var(--card-hover);
}

.accordion-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.accordion-header-date {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
}

.accordion-header-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.accordion-badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

.accordion-badge--slots {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
}

.accordion-badge--places {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.accordion-chevron {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.accordion-item.open .accordion-chevron {
    transform: rotate(180deg);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.accordion-body-inner {
    padding: 0 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.accordion-slot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--card);
    border-radius: 6px;
    font-size: 13px;
}

.accordion-slot-time {
    font-weight: 600;
    color: var(--primary);
}

.accordion-slot-places {
    color: var(--warning);
    font-weight: 600;
    font-size: 12px;
}

/* Donate banner */
.donate-banner {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(251, 191, 36, 0.03));
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 24px;
    margin-bottom: 16px;
    text-align: center;
}

.donate-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.donate-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.donate-desc {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.donate-options {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.donate-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
    flex: 1;
    max-width: 120px;
}

.donate-option:hover {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.donate-option:active {
    transform: translateY(0);
}

.donate-coffee-icon {
    width: 36px;
    height: 36px;
}

.donate-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.donate-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.donate-powered {
    margin-top: 14px;
    font-size: 11px;
    color: #475569;
}

.donate-powered a {
    color: #64748b;
    text-decoration: none;
}

.donate-powered a:hover {
    color: #f59e0b;
}

/* === Pulse dot === */
.pulse-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--success);
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
    position: relative;
    top: -1px;
}
.pulse-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    background: var(--success);
    border-radius: 50%;
    opacity: 0.5;
    animation: pulse-ring 1.8s ease-out infinite;
}
@keyframes pulse-ring {
    0%   { transform: scale(0.8); opacity: 0.5; }
    100% { transform: scale(2.4); opacity: 0; }
}

/* === Header gradient === */
.header {
    background: radial-gradient(ellipse at 50% 0%, rgba(59, 130, 246, 0.1) 0%, transparent 65%);
    border-radius: 20px;
}

/* === Date urgency === */
.date-item--urgent {
    border-left: 3px solid var(--success);
    padding-left: 9px;
}
.date-item--soon {
    border-left: 3px solid var(--warning);
    padding-left: 9px;
}
.accordion-item--urgent { border-left: 3px solid var(--success); }
.accordion-item--soon   { border-left: 3px solid var(--warning); }

.urgency-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-left: 6px;
    vertical-align: middle;
}
.urgency-tag--urgent { background: rgba(16,185,129,0.15); color: var(--success); }
.urgency-tag--soon   { background: rgba(245,158,11,0.15); color: var(--warning); }

/* === Countdown === */
.countdown-widget {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--input-bg);
    border-radius: 8px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.countdown-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    min-width: 42px;
    text-align: center;
}

/* === Calendar === */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.calendar-month-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
}
.calendar-nav-btn {
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    padding: 0;
}
.calendar-nav-btn:hover {
    background: var(--card-hover);
    color: var(--text);
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}
.calendar-header {
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 4px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: default;
    position: relative;
    transition: background 0.15s;
}
.calendar-day--current-month {
    color: var(--text);
}
.calendar-day--past {
    opacity: 0.35;
}
.calendar-day--today {
    border: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 700;
}
.calendar-day--exam {
    background: rgba(16, 185, 129, 0.18);
    color: var(--success);
    font-weight: 700;
}
.calendar-day--exam::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--success);
    border-radius: 50%;
}
.calendar-day--exam.calendar-day--today {
    border-color: var(--success);
}
.calendar-day--weekend {
    color: #64748b;
}
.calendar-day--exam.calendar-day--weekend {
    color: var(--success);
}
.calendar-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
}
.calendar-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.calendar-legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}
.calendar-legend-swatch--exam {
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid var(--success);
}
.calendar-legend-swatch--today {
    border: 2px solid var(--primary);
    border-radius: 4px;
}

/* === History === */
.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    gap: 8px;
}
.history-item:last-child { border-bottom: none; padding-bottom: 0; }
.history-date { color: var(--text-muted); white-space: nowrap; }
.history-count {
    background: rgba(16,185,129,0.12);
    color: var(--success);
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 400px) {
    .container { padding: 12px; }
    .header { padding: 24px 0; }
    .header h1 { font-size: 20px; }
    .card { padding: 16px; }
    .status-grid { grid-template-columns: 1fr; }
    .date-item { flex-direction: column; align-items: flex-start; gap: 6px; }
    .date-item-left { flex-wrap: wrap; }
}
