@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;0,700;1,400;1,600&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
    --sage: #4a7c59;
    --sage-light: #e8f0eb;
    --sage-mid: #b8d4bf;
    --warm: #c17b3f;
    --warm-light: #fdf3e8;
    --stone: #3d3530;
    --stone-mid: #7a6e69;
    --stone-light: #f5f2f0;
    --stone-border: #e8e2dd;
    --white: #fefdfb;
    --red: #dc3545;
    --radius: 16px;
    --shadow: 0 2px 16px rgba(61,53,48,0.08);
    --shadow-lg: 0 8px 32px rgba(61,53,48,0.14);
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--stone-light);
    color: var(--stone);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
}

h1,h2,h3,h4,h5 { font-family: 'Lora', serif; line-height: 1.25; }

a { color: var(--sage); text-decoration: none; }
a:hover { text-decoration: underline; }

/* NAV */
.navbar {
    background: rgba(254,253,251,0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--stone-border);
    padding: 14px 24px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 100;
}
.navbar-brand {
    display: flex; align-items: center; gap: 10px; text-decoration: none;
    font-family: 'Lora', serif; font-weight: 700; font-size: 1.2rem; color: var(--stone);
}
.navbar-brand-mark {
    width: 34px; height: 34px; background: var(--sage-light);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: var(--sage);
}
.navbar-right { display: flex; align-items: center; gap: 10px; }
.nav-avatar { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--stone-border); object-fit: cover; }

/* LAYOUT */
.container { max-width: 680px; margin: 0 auto; padding: 0 20px; }
.container-wide { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.page-wrap { padding: 32px 0 60px; }

/* BUTTONS */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border-radius: 100px;
    font-family: 'DM Sans', sans-serif; font-size: 0.92rem; font-weight: 600;
    cursor: pointer; border: none; transition: all 0.2s; text-decoration: none;
    white-space: nowrap; line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--sage); color: white; }
.btn-primary:hover { background: #3d6b4a; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(74,124,89,0.3); color: white; }
.btn-outline { background: transparent; color: var(--sage); border: 2px solid var(--sage-mid); }
.btn-outline:hover { background: var(--sage-light); color: var(--sage); }
.btn-warm { background: var(--warm); color: white; }
.btn-warm:hover { background: #a8692e; color: white; }
.btn-ghost { background: var(--stone-light); color: var(--stone); border: 1px solid var(--stone-border); }
.btn-ghost:hover { background: var(--stone-border); }
.btn-danger { background: var(--red); color: white; }
.btn-sm { padding: 8px 16px; font-size: 0.82rem; }
.btn-lg { padding: 16px 32px; font-size: 1rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* FORMS */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 6px; color: var(--stone); }
.form-label span { font-weight: 400; color: var(--stone-mid); }
.form-control {
    width: 100%; padding: 12px 14px; border-radius: 10px;
    border: 2px solid var(--stone-border); background: var(--white);
    font-family: 'DM Sans', sans-serif; font-size: 0.92rem; color: var(--stone);
    transition: all 0.2s; outline: none;
}
.form-control:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(74,124,89,0.1); }
.form-control-icon { position: relative; }
.form-control-icon .form-control { padding-left: 42px; }
.form-control-icon .icon, .form-control-icon > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--stone-mid); pointer-events: none; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: 0.8rem; color: var(--stone-mid); margin-top: 5px; }
.form-error { font-size: 0.82rem; color: var(--red); margin-top: 5px; }

/* CHECKBOX */
.checkbox-group { display: flex; flex-direction: column; gap: 10px; }
.checkbox-item {
    display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
    border: 2px solid var(--stone-border); border-radius: 12px; cursor: pointer;
    transition: all 0.2s; background: var(--white);
}
.checkbox-item:hover { border-color: var(--sage-mid); }
.checkbox-item input[type=checkbox], .checkbox-item input[type=radio] { 
    width: 18px; height: 18px; margin-top: 1px; accent-color: var(--sage); flex-shrink: 0; cursor: pointer;
}
.checkbox-item.selected { border-color: var(--sage); background: var(--sage-light); }
.checkbox-label { font-size: 0.9rem; line-height: 1.45; }
.checkbox-label strong { display: block; font-weight: 600; margin-bottom: 2px; }
.checkbox-label span { color: var(--stone-mid); font-size: 0.83rem; }

/* CARDS */
.card {
    background: var(--white); border: 1px solid var(--stone-border);
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.card-body { padding: 24px; }
.card-footer { padding: 16px 24px; background: var(--stone-light); border-top: 1px solid var(--stone-border); }

/* ALERTS */
.alert { padding: 14px 16px; border-radius: 10px; font-size: 0.9rem; margin-bottom: 20px; display: flex; align-items: flex-start; gap: 10px; }
.alert-success { background: #e6f4ea; color: #2d7a3a; border: 1px solid #b8d4bf; }
.alert-error { background: #fde8e8; color: #c0392b; border: 1px solid #f5b7b1; }
.alert-info { background: var(--sage-light); color: var(--sage); border: 1px solid var(--sage-mid); }
.alert-warn { background: var(--warm-light); color: var(--warm); border: 1px solid #e8c49a; }

/* BADGES */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 100px; font-size: 0.75rem; font-weight: 600; }
.badge-sage { background: var(--sage-light); color: var(--sage); }
.badge-warm { background: var(--warm-light); color: var(--warm); }
.badge-green { background: #e6f4ea; color: #2d7a3a; }
.badge-stone { background: var(--stone-light); color: var(--stone-mid); }

/* EVENT CARD */
.event-card { cursor: pointer; transition: all 0.2s; margin-bottom: 20px; text-decoration: none; display: block; color: inherit; }
.event-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; color: inherit; }
.event-card-img { position: relative; height: 170px; overflow: hidden; }
.event-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.event-card:hover .event-card-img img { transform: scale(1.04); }
.event-card-sponsor {
    position: absolute; top: 10px; left: 10px;
    background: rgba(255,255,255,0.95); backdrop-filter: blur(8px);
    border-radius: 8px; padding: 4px 10px;
    display: flex; align-items: center; gap: 6px; font-size: 0.73rem; font-weight: 600;
}
.event-card-free { position: absolute; bottom: 10px; right: 10px; background: var(--sage); color: white; border-radius: 100px; padding: 3px 10px; font-size: 0.73rem; font-weight: 700; }
.event-card-joined { position: absolute; bottom: 10px; left: 10px; background: #2d7a3a; color: white; border-radius: 100px; padding: 3px 10px; font-size: 0.73rem; font-weight: 700; }
.event-card-body { padding: 18px; }
.event-card-title { font-size: 1.05rem; margin-bottom: 5px; }
.event-card-venue { display: flex; align-items: center; gap: 5px; color: var(--stone-mid); font-size: 0.83rem; margin-bottom: 12px; }
.event-card-meta { display: flex; gap: 16px; padding-top: 12px; border-top: 1px solid var(--stone-border); }
.event-card-meta-item { display: flex; align-items: center; gap: 5px; font-size: 0.82rem; color: var(--stone-mid); }

/* TABS */
.tabs { display: flex; background: var(--stone-light); border-radius: 12px; padding: 4px; margin-bottom: 24px; border: 1px solid var(--stone-border); }
.tab-btn { flex: 1; padding: 10px; border: none; background: none; cursor: pointer; border-radius: 9px; font-family: 'DM Sans', sans-serif; font-weight: 500; font-size: 0.88rem; color: var(--stone-mid); transition: all 0.2s; }
.tab-btn.active { background: var(--white); color: var(--stone); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* PREFERENCE CARDS */
.pref-grid { display: flex; flex-direction: column; gap: 10px; }
.pref-card {
    border: 2px solid var(--stone-border); border-radius: 14px;
    padding: 16px 18px; cursor: pointer; transition: all 0.2s; background: var(--white);
    display: flex; align-items: center; gap: 14px;
}
.pref-card:hover { border-color: var(--sage-mid); }
.pref-card.selected { border-color: var(--sage); background: var(--sage-light); }
.pref-card input[type=radio] { accent-color: var(--sage); width: 18px; height: 18px; flex-shrink: 0; }
.pref-icon { font-size: 1.5rem; }
.pref-text strong { display: block; font-weight: 600; font-size: 0.93rem; }
.pref-text span { font-size: 0.82rem; color: var(--stone-mid); }

/* FOOTER */
footer { background: var(--stone-light); border-top: 1px solid var(--stone-border); padding: 28px 24px; text-align: center; color: var(--stone-mid); font-size: 0.83rem; }

/* FLASH */
.flash-wrap { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 999; min-width: 280px; max-width: 90vw; }

/* QR CODE */
.qr-box { text-align: center; padding: 28px; }
.qr-code-display { font-family: monospace; font-size: 0.85rem; background: var(--stone-light); padding: 12px; border-radius: 8px; word-break: break-all; letter-spacing: 0.05em; }

/* ADMIN */
.admin-sidebar { width: 220px; background: var(--stone); min-height: 100vh; padding: 24px 0; flex-shrink: 0; }
.admin-sidebar .brand { color: white; font-family: 'Lora', serif; font-size: 1.1rem; padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 12px; }
.admin-nav-item { display: block; padding: 11px 20px; color: rgba(255,255,255,0.65); font-size: 0.88rem; text-decoration: none; transition: all 0.2s; display: flex; align-items: center; gap: 10px; }
.admin-nav-item:hover, .admin-nav-item.active { background: rgba(255,255,255,0.08); color: white; text-decoration: none; }
.admin-content { flex: 1; padding: 28px; background: var(--stone-light); min-height: 100vh; }
.admin-layout { display: flex; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--white); border: 1px solid var(--stone-border); border-radius: var(--radius); padding: 20px; }
.stat-num { font-family: 'Lora', serif; font-size: 2rem; color: var(--sage); }
.stat-label { font-size: 0.82rem; color: var(--stone-mid); margin-top: 4px; }
table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th { background: var(--stone-light); padding: 12px 14px; text-align: left; font-size: 0.82rem; font-weight: 600; color: var(--stone-mid); text-transform: uppercase; letter-spacing: 0.04em; }
td { padding: 12px 14px; border-top: 1px solid var(--stone-border); font-size: 0.88rem; vertical-align: middle; }
tr:hover td { background: rgba(74,124,89,0.03); }

/* RESPONSIVE */
@media (max-width: 600px) {
    .navbar { padding: 12px 16px; }
    .container { padding: 0 16px; }
    .admin-sidebar { display: none; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ANIMATIONS */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp 0.4s ease forwards; }
.fade-up-1 { animation-delay: 0.05s; opacity: 0; }
.fade-up-2 { animation-delay: 0.12s; opacity: 0; }
.fade-up-3 { animation-delay: 0.2s; opacity: 0; }
.fade-up-4 { animation-delay: 0.28s; opacity: 0; }
