:root {
    --site-ink: #2f292e;
    --site-muted: #6f696d;
    --site-plum: #5a3d55;
    --site-plum-dark: #432e40;
    --site-gold: #b68a5b;
    --site-ivory: #f7f3ee;
    --site-line: #e7dfd8;
    --site-white: #fff;
}

html { font-size: 16px; }
body {
    min-height: 100vh;
    color: var(--site-ink);
    background: var(--site-ivory) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}
a { color: var(--site-plum); }
a:hover { color: var(--site-plum-dark); }

.container,
.container:hover,
.card-body,
.main-content {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin-top: 0;
    margin-bottom: 0;
}

.card {
    background: var(--site-white);
    border: 1px solid var(--site-line);
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(47, 41, 46, .06);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.card:hover { box-shadow: 0 10px 32px rgba(47, 41, 46, .08); }
.card-body { padding: 1.35rem; }
.card-header { padding: 1rem 1.25rem; background: #fbf9f7; border-bottom: 1px solid var(--site-line); }
.card-header h1, .card-header h2, .card-header h3, .card-header h4, .card-header h5 { margin-bottom: 0; }

.btn { min-height: 44px; padding: .62rem 1.15rem; border-radius: 9px; font-size: 1rem; font-weight: 600; }
.btn-sm { min-height: 38px; padding: .42rem .8rem; font-size: .9rem; }
.btn-primary,
.card a.btn-primary,
.memorial-card a.btn-primary { background: var(--site-plum) !important; border-color: var(--site-plum) !important; color: #fff !important; }
.btn-primary:hover,
.card a.btn-primary:hover,
.memorial-card a.btn-primary:hover { background: var(--site-plum-dark) !important; border-color: var(--site-plum-dark) !important; }
.btn-outline-primary,
.card a.btn-outline-primary { background: transparent !important; border: 1px solid var(--site-plum) !important; color: var(--site-plum) !important; }
.btn-outline-primary:hover,
.card a.btn-outline-primary:hover { background: var(--site-plum) !important; color: #fff !important; }
.btn-success { background: #356b4c !important; border-color: #356b4c !important; }

.form-control, .form-select { min-height: 46px; border-color: #cfc5bd; }
.form-control:focus, .form-select:focus { border-color: var(--site-plum); box-shadow: 0 0 0 .2rem rgba(90, 61, 85, .15); }
.form-label { font-weight: 600; }

.skip-link { position: fixed; left: 1rem; top: -80px; z-index: 99999; padding: .65rem 1rem; background: #fff; color: var(--site-plum); border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,.18); }
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 3px solid rgba(182, 138, 91, .85); outline-offset: 3px; }

.site-header { position: relative; z-index: 1050; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--site-line); }
.site-header .navbar { min-height: 72px; padding: .45rem 0; background: transparent !important; box-shadow: none; }
.site-header .navbar-brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--site-ink) !important; }
.site-header .navbar-brand img { object-fit: contain; }
.site-header .navbar-brand span { display: flex; flex-direction: column; line-height: 1.15; }
.site-header .navbar-brand strong { font-size: 1.12rem; letter-spacing: .08em; }
.site-header .navbar-brand small { margin-top: .2rem; color: var(--site-muted); font-size: .72rem; letter-spacing: .08em; }
.site-header .nav-link { min-height: 44px; display: flex; align-items: center; margin: 0 .12rem; padding: .6rem .8rem; border-radius: 8px; color: #494247 !important; text-decoration: none !important; }
.site-header .nav-link:hover, .site-header .nav-link.active { color: var(--site-plum) !important; background: #f2ebf0 !important; }
.site-register-btn { margin-left: .4rem; min-height: 40px; padding: .48rem 1rem; }
.dropdown-menu { border-color: var(--site-line); }

#site-content { min-height: calc(100vh - 360px); }
.flash-stack { padding-top: 1rem; }

.site-footer { margin-top: 4rem; padding: 3rem 0 1.25rem; background: #302a2f; color: rgba(255,255,255,.82); }
.footer-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1.2fr; gap: 2rem; }
.footer-grid strong { display: block; margin-bottom: .8rem; color: #fff; }
.footer-grid p { max-width: 390px; line-height: 1.8; }
.footer-grid nav, .footer-contact { display: flex; flex-direction: column; align-items: flex-start; gap: .55rem; }
.site-footer a { color: rgba(255,255,255,.78); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,.14); font-size: .88rem; }

.auth-page { padding: 3rem 1rem; }
.auth-shell { max-width: 520px; margin: 0 auto; }
.auth-intro { margin-bottom: 1.5rem; text-align: center; }
.auth-intro h1 { font-size: 1.75rem; }
.auth-intro p { color: var(--site-muted); }
.auth-card { padding: .5rem; }
.auth-card .card-body { padding: 1.6rem; }

.empty-state { padding: 2.5rem 1.25rem; text-align: center; color: var(--site-muted); background: #fbf9f7; border: 1px dashed #d7ccc3; border-radius: 12px; }

@media (max-width: 991px) {
    .site-header .navbar-collapse { margin-top: .65rem; padding: .75rem; background: #fff; border: 1px solid var(--site-line); border-radius: 12px; box-shadow: 0 12px 30px rgba(47,41,46,.1); }
    .site-register-btn { margin: .35rem 0 0; width: 100%; }
    .footer-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 576px) {
    html { font-size: 16px; }
    .container { width: 100%; margin-left: auto !important; margin-right: auto !important; padding-left: 1rem !important; padding-right: 1rem !important; }
    .card-body { padding: 1.1rem; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; }
    .site-footer { margin-top: 2.5rem; padding-top: 2.25rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
