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

:root {
    --bg:          #fdf2f8;
    --surface:     #ffffff;
    --border:      #f0d6e8;
    --shadow:      rgba(180,60,120,.07);
    --primary:     #c2185b;
    --primary-h:   #ad1457;
    --danger:      #b91c1c;
    --danger-h:    #991b1b;
    --text:        #1a0a12;
    --muted:       #9e6b85;
    --success-bg:  #fdf0f8;
    --success-bd:  #f4a7d0;
    --success-txt: #8b1a4a;
    --error-bg:    #fef2f2;
    --error-bd:    #fecaca;
    --radius:      10px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', "Roboto", sans-serif;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── Navbar ─────────────────────────────────────────────────────────────── */
#navbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background-image: linear-gradient(rgba(194, 24, 92, 0.9), rgba(173, 20, 86, 0.9)), url("../images/bows_background.png");
    padding: 0 1.5rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(180,60,120,.25);
}

/* [hidden] on <header> overrides display:flex — restore with CSS */
#navbar[hidden] { display: none; }

.nav-brand {
    font-family: var(--font);
    font-weight: 450;
    font-size: 1.5rem;
    color: #fff;
}

nav { display: flex; gap: .25rem; }

.btn-link {
    color: rgba(255,255,255,.85) !important;
}
.btn-link:hover {
    color: #fff !important;
    background: rgba(255,255,255,.15) !important;
}

/* ── Main content ────────────────────────────────────────────────────────── */
#app {
    width: 100%;
    padding: 0;
    height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Auth views handled entirely by auth.css */

/* ── Card ────────────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 4px var(--shadow);
    padding: 2rem;
}

/* ── Form controls ───────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

label {
    display: block;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: .375rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
textarea {
    width: 100%;
    padding: .625rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: .9375rem;
    color: var(--text);
    background: var(--surface);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

input:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

textarea { resize: vertical; min-height: 120px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .625rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: .9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, opacity .15s;
    white-space: nowrap;
}

.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-h); }

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-secondary:hover:not(:disabled) { background: rgba(37,99,235,.06); }

.btn-sm {
    padding: .375rem .75rem;
    font-size: .875rem;
}

/* Navbar / text-only button */
.btn-link {
    background: none;
    border: none;
    color: var(--muted);
    font-family: var(--font);
    font-size: .9375rem;
    cursor: pointer;
    padding: .25rem .625rem;
    border-radius: 6px;
    transition: color .15s, background .15s;
}
.btn-link:hover { color: var(--text); background: var(--bg); }

/* Inline message-card action buttons */
.btn-action {
    font-size: .8125rem;
    padding: .3125rem .75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    font-family: var(--font);
    transition: background .15s;
}
.btn-action:hover:not(:disabled) { background: var(--border); }
.btn-action:disabled { opacity: .55; cursor: not-allowed; }
.btn-action.danger { color: var(--danger); border-color: var(--error-bd); background: var(--error-bg); }
.btn-action.danger:hover:not(:disabled) { background: #fee2e2; }

/* ── Feedback messages ────────────────────────────────────────────────────── */
.error-msg, .success-msg {
    font-size: .875rem;
    margin-top: .875rem;
    padding: .625rem .875rem;
    border-radius: var(--radius);
    border-width: 1px;
    border-style: solid;
}

.error-msg   { color: var(--danger);      background: var(--error-bg);   border-color: var(--error-bd); }
.success-msg { color: var(--success-txt); background: var(--success-bg); border-color: var(--success-bd); }
.warning-msg { color: #92400e;            background: #fffbeb;           border-color: #fcd34d; }

/* ── Loading spinner ──────────────────────────────────────────────────────── */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .625rem;
    padding: 3rem;
    color: var(--muted);
    font-size: .9375rem;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
    animation: spin .7s linear infinite;
}

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

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3.5rem 1rem;
    color: var(--muted);
    font-size: .9375rem;
}

#site-footer { display: none; }

/* ── Change password dialog ──────────────────────────────────────────────── */
dialog {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    font-family: var(--font);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

dialog::backdrop {
    background: rgba(0,0,0,.35);
}
