/* ==========================================================
   Bestatter-Portal – Shared Stylesheet
   ========================================================== */

[hidden] { display: none !important; }

:root {
    --color-cream: #FDF8F3;
    --color-warm-white: #FFFBF7;
    --color-gold: #C9A86C;
    --color-gold-light: #E8D4B8;
    --color-gold-lighter: #F4E9D7;
    --color-gold-dark: #8B7355;
    --color-brown: #5D4E3A;
    --color-brown-light: #7A6B57;
    --color-text: #3D3426;
    --color-text-light: #6B5D4D;
    --color-success: #4CAF50;
    --color-error: #e74c3c;
    --color-info: #3498db;
    --color-warning: #f39c12;
    --color-border: #EFE3CF;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-soft: 0 4px 20px rgba(93, 78, 58, 0.06);
    --shadow-medium: 0 10px 40px rgba(93, 78, 58, 0.12);
    --shadow-hover: 0 8px 30px rgba(93, 78, 58, 0.10);
    --transition: all 0.25s ease;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Source Sans 3', -apple-system, sans-serif;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main, .portal-body { flex: 1; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    line-height: 1.3;
    color: var(--color-brown);
    font-weight: 600;
}

h1 { font-size: 1.85rem; font-weight: 700; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

a { color: var(--color-gold-dark); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--color-gold); }

img { max-width: 100%; display: block; }

button { font-family: inherit; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--color-gold);
    color: #fff;
    border-color: var(--color-gold);
    box-shadow: 0 2px 8px rgba(201, 168, 108, 0.25);
}
.btn-primary:hover {
    background: var(--color-gold-dark);
    border-color: var(--color-gold-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(139, 115, 85, 0.3);
}

.btn-secondary {
    background: #fff;
    color: var(--color-brown);
    border-color: var(--color-gold-light);
}
.btn-secondary:hover {
    background: var(--color-gold-lighter);
    border-color: var(--color-gold);
    color: var(--color-brown);
}

.btn-ghost {
    background: transparent;
    color: var(--color-gold-dark);
    border-color: transparent;
    padding: 0.5rem 0.75rem;
}
.btn-ghost:hover {
    background: var(--color-gold-lighter);
    color: var(--color-brown);
}

.btn-danger {
    background: transparent;
    color: var(--color-error);
    border-color: #f5c8c3;
}
.btn-danger:hover {
    background: var(--color-error);
    border-color: var(--color-error);
    color: #fff;
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
}

.btn-large {
    padding: 0.85rem 1.75rem;
    font-size: 1.02rem;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ── Form ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1.15rem; }

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--color-brown);
    margin-bottom: 0.4rem;
    font-size: 0.88rem;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.72rem 0.95rem;
    border: 1.5px solid var(--color-gold-light);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text);
    background: #fff;
    transition: var(--transition);
}
.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-light);
    opacity: 0.55;
}
.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(201, 168, 108, 0.18);
}
.form-textarea { resize: vertical; min-height: 90px; font-family: var(--font-body); }
.form-hint { font-size: 0.8rem; color: var(--color-text-light); margin-top: 0.3rem; }

/* ── Card ───────────────────────────────────────────────── */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 1.5rem;
    border: 1px solid var(--color-border);
}

/* ── Badges ─────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.badge-created     { background: #f0ece3; color: #8a7a5c; }
.badge-email-sent  { background: #e8f4fd; color: var(--color-info); }
.badge-uploading   { background: #fef5e0; color: #b7791f; }
.badge-submitted   { background: #e8f5e9; color: #2e7d32; }
.badge-processing  { background: #f3e8fd; color: #8e44ad; }
.badge-done        { background: #e8f5e9; color: #2e7d32; }

/* ── Footer ─────────────────────────────────────────────── */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--color-text-light);
    font-size: 0.85rem;
}
.footer a { color: var(--color-text-light); text-decoration: underline; text-underline-offset: 2px; }
.footer a:hover { color: var(--color-gold); }

/* ── Spinner ────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 22px; height: 22px;
    border: 3px solid var(--color-gold-light);
    border-top-color: var(--color-gold);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utility ────────────────────────────────────────────── */
.text-muted { color: var(--color-text-light); }
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
