/* ==============================================================
   In Memory of Dr. Hemant Patel — Theme
   Palette: warm charcoal ground, brass/candlelight accent.
   Type: serif for headings (a quiet, respectful register),
         humanist sans for body & UI chrome.
   ============================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&family=Inter:wght@400;500;600&display=swap');

:root {
    --bg:            #171410;
    --bg-alt:        #1e1a15;
    --surface:       #232019;
    --surface-raised:#2a251d;
    --border:        #3a3327;
    --text:          #ece6da;
    --text-muted:    #b3a893;
    --text-faint:    #7d7362;
    --brass:         #c9944f;
    --brass-bright:  #e0ac66;
    --brass-dim:     #8a6a3d;
    --error:         #d97b6c;
    --success:       #8fae7a;
    --shadow:        0 12px 30px rgba(0,0,0,0.35);
    --radius:        3px;
    --serif:         'Source Serif 4', Georgia, 'Times New Roman', serif;
    --sans:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at top, rgba(201,148,79,0.07), transparent 55%);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('../img/floral-pattern.jpg');
    background-size: 550px;
    background-repeat: repeat;
    opacity: 0.1;
    pointer-events: none;
    z-index: -1;
}

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

img { max-width: 100%; display: block; }

::selection { background: var(--brass-dim); color: #fff; }

:focus-visible {
    outline: 2px solid var(--brass-bright);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* ---------- Layout shells ---------- */

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.wrap {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 24px;
}

.wrap-wide {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Header / hero ---------- */

.site-header {
    padding: 56px 0 40px;
    border-bottom: 1px solid var(--border);
    background:
        linear-gradient(180deg, rgba(201,148,79,0.06), transparent 70%);
}

.site-header .flame {
    display: inline-block;
    font-size: 28px;
    margin-bottom: 18px;
    filter: drop-shadow(0 0 14px rgba(224,172,102,0.55));
}

.site-title {
    font-family: var(--serif);
    font-weight: 600;
    margin: 0 0 10px;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.site-title .title-prefix {
    font-family: var(--sans);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--brass-dim);
    font-weight: 500;
}
.site-title .title-name {
    font-family: 'Playfair Display', var(--serif);
    font-size: clamp(32px, 5vw, 48px);
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.site-subtitle {
    font-size: 16px;
    color: var(--text-muted);
}

/* ---------- Card / form ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.form-section {
    padding: 36px clamp(20px, 5vw, 40px) 40px;
    margin-bottom: 24px;
}

.hero-split {
    display: flex;
    gap: 60px;
    align-items: center;
    margin: 0 auto 60px;
    max-width: 1200px;
}

.hero-image {
    flex: 1.6;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: block;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.hero-image img:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

/* Lightbox styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
    border: 2px solid var(--border);
    border-radius: 4px;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    transition: color 0.2s ease;
}

.lightbox-close:hover {
    color: var(--brass-bright);
}

.hero-text {
    flex: 1;
    font-size: 18px;
    line-height: 1.6;
}

.hero-text .intro-list {
    margin: 20px 0;
    font-style: italic;
    color: var(--brass-bright);
    font-family: var(--serif);
    font-size: 19px;
    line-height: 1.6;
}

.form-container {
    width: 100%;
    max-width: 640px;
}

@media (max-width: 900px) {
    .hero-split {
        flex-direction: column;
        gap: 32px;
        text-align: center;
    }
    
    .hero-text {
        font-size: 16px;
    }
}

fieldset {
    border: 0;
    margin: 0 0 28px;
    padding: 0;
}

legend {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--brass-bright);
    padding: 0 0 12px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    width: 100%;
}

.field {
    margin-bottom: 18px;
}

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

.field .hint {
    font-size: 12px;
    color: var(--text-faint);
    margin-top: 5px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 560px) {
    .field-row { grid-template-columns: 1fr; }
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    width: 100%;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    padding: 11px 13px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--brass);
    background: #201d17;
    box-shadow: 0 0 0 3px rgba(201,148,79,0.15);
    outline: none;
}

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

/* file input */
.file-drop {
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg-alt);
    padding: 22px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.file-drop:hover, .file-drop.dragover {
    border-color: var(--brass);
    background: rgba(201,148,79,0.05);
}

.file-drop input[type="file"] { display: none; }

.file-drop .file-drop-label {
    color: var(--text-muted);
    font-size: 14px;
}

.file-drop .file-drop-label strong { color: var(--brass-bright); }

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.preview-grid .thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.preview-grid .thumb img {
    width: 100%; height: 100%; object-fit: cover;
}

/* honeypot - hidden from real users */
.hp-field { position: absolute; left: -9999px; top: -9999px; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--brass);
    color: #1a1510;
    border: 1px solid var(--brass);
    border-radius: var(--radius);
    font-family: var(--sans);
    font-weight: 600;
    font-size: 14.5px;
    padding: 12px 22px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
}

.btn:hover { background: var(--brass-bright); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-block { width: 100%; }

.btn-submit {
    margin-top: 24px;
    padding: 16px 24px;
    font-size: 16px;
}
#submitBtn:hover {
    border-color: rgba(255,255,255,0.4) !important;
    color: #fff !important;
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--brass); color: var(--brass-bright); background: transparent; }

.btn-sm { padding: 7px 14px; font-size: 13px; }

.btn-danger { background: var(--error); border-color: var(--error); color: #241210; }
.btn-danger:hover { background: #e08e7f; }

/* ---------- Alerts ---------- */

.alert {
    border-radius: var(--radius);
    padding: 13px 16px;
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success { background: rgba(143,174,122,0.12); border-color: rgba(143,174,122,0.4); color: var(--success); }
.alert-error   { background: rgba(217,123,108,0.12); border-color: rgba(217,123,108,0.4); color: var(--error); }

/* ---------- Footer ---------- */

.site-footer {
    margin-top: auto;
    padding: 28px 0 40px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-faint);
}

/* ---------- Thank you page ---------- */

.thankyou {
    text-align: center;
    padding: 70px 20px;
}
.thankyou .flame { font-size: 36px; margin-bottom: 20px; display:block; }
.thankyou h1 { font-family: var(--serif); font-size: 26px; margin-bottom: 12px; }
.thankyou p { color: var(--text-muted); max-width: 460px; margin: 0 auto 26px; }

/* ==============================================================
   Admin
   ============================================================== */

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
}

.admin-topbar .brand {
    font-family: var(--serif);
    font-size: 18px;
    color: var(--text);
}

.admin-topbar .brand span { color: var(--brass-bright); }

.admin-topbar nav a {
    color: var(--text-muted);
    font-size: 14px;
    margin-left: 18px;
}
.admin-topbar nav a:hover { color: var(--brass-bright); }

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 36px 32px;
}

.login-card h1 {
    font-family: var(--serif);
    font-size: 22px;
    text-align: center;
    margin: 0 0 26px;
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 26px;
}

.stat-box {
    padding: 18px 20px;
    text-align: left;
}

.stat-box .num {
    font-family: var(--serif);
    font-size: 26px;
    color: var(--brass-bright);
}

.stat-box .label {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.toolbar form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.toolbar input[type="text"],
.toolbar input[type="date"] {
    padding: 9px 11px;
    font-size: 13.5px;
    width: auto;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--surface);
}

table.data th, table.data td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

table.data th {
    background: var(--surface-raised);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12.5px;
    text-transform: none;
    position: sticky;
    top: 0;
}

table.data th a { color: var(--text-muted); }
table.data th a:hover { color: var(--brass-bright); }

table.data tbody tr:hover { background: rgba(201,148,79,0.04); }

table.data td.msg-cell {
    white-space: normal;
    max-width: 320px;
    color: var(--text-muted);
}

.pill {
    display: inline-block;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    padding: 2px 9px;
    border-radius: 20px;
}

.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 26px 0 10px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 7px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-muted);
}

.pagination a:hover { border-color: var(--brass); color: var(--brass-bright); text-decoration: none; }

.pagination .current {
    background: var(--brass);
    color: #1a1510;
    border-color: var(--brass);
}

.detail-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 10px 20px;
    margin-bottom: 30px;
}

.detail-grid dt { color: var(--text-muted); font-size: 13px; }
.detail-grid dd { margin: 0; font-size: 15px; }

@media (max-width: 600px) {
    .detail-grid { grid-template-columns: 1fr; }
    .detail-grid dt { margin-top: 10px; }
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.gallery a {
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    aspect-ratio: 1;
}

.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s ease; }
.gallery a:hover img { transform: scale(1.05); }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.back-link { display: inline-block; margin-bottom: 18px; font-size: 13.5px; }

/* ---------- New Form Elements ---------- */

.intro-text {
    font-size: 16px;
    margin-bottom: 40px;
    color: var(--text-muted);
}
.intro-text p { margin-bottom: 16px; }
.intro-text .intro-list {
    padding-left: 20px;
    border-left: 2px solid var(--border);
    font-style: italic;
    color: var(--text);
}

.opt { color: var(--text-faint); font-weight: normal; }
.field-desc { font-size: 14px; color: var(--text-muted); margin: -8px 0 16px; }
.checkbox-field label { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; color: var(--text); cursor: pointer; }
.checkbox-field input[type="checkbox"] { margin-top: 3px; }

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    margin-bottom: 8px;
}
.radio-label input[type="radio"] { margin: 0; }
.radio-label:hover { color: var(--text); }

.consent-block {
    background: rgba(201,148,79,0.05);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}
.consent-block p {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.consent-block p:last-of-type { margin-bottom: 0; }

.audio-tabs { display: flex; gap: 10px; margin-bottom: 16px; }
.audio-tabs .btn { border-color: transparent; }
.audio-tabs .btn.active { background: rgba(201,148,79,0.1); border-color: var(--brass-dim); color: var(--brass-bright); }
.audio-panel { padding: 20px; background: var(--bg-alt); border: 1px dashed var(--border); border-radius: var(--radius); text-align: center; }
.record-status { display: inline-block; margin-left: 12px; font-size: 14px; color: var(--error); }
.record-status.recording { animation: blink 1.5s infinite; }
@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0.3; } 100% { opacity: 1; } }

.photo-caption-row {
    display: flex;
    gap: 16px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: var(--radius);
    margin-top: 12px;
}
.photo-caption-row img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius);
}
.photo-caption-fields { flex: 1; display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.photo-caption-fields input, .photo-caption-fields textarea { font-size: 13px; padding: 8px 10px; }
.photo-caption-fields .full { grid-column: 1 / -1; }
@media (max-width: 600px) {
    .photo-caption-row { flex-direction: column; }
    .photo-caption-fields { grid-template-columns: 1fr; }
}
}


