/* ===== REST BLOOM - SHARED DESIGN SYSTEM ===== */
/* Matches landing page design tokens */

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

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

:root {
    --sage: #7A8B6F;
    --sage-light: #A8B89E;
    --sage-dark: #5C6B52;
    --cream: #FAF8F4;
    --cream-warm: #F5F0E8;
    --stone: #E8E2D8;
    --charcoal: #2C2C2C;
    --text: #3A3A3A;
    --text-light: #6B6B6B;
    --petal: #D4A8A8;
    --petal-soft: #E8CBCB;
    --moss: #4A5A40;
    --white: #FFFFFF;
    --error: #C75050;
    --success: #5C8A4E;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--cream);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== NAVIGATION BAR ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(250, 248, 244, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(232, 226, 216, 0.6);
    padding: 0.85rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--charcoal);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand span { font-size: 1.3rem; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--sage-dark);
}

.nav-links a.active {
    color: var(--sage-dark);
    font-weight: 600;
}

.btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--sage);
    color: white !important;
    padding: 0.5rem 1.15rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.btn-nav:hover {
    background: var(--sage-dark);
    transform: translateY(-1px);
}

/* ===== PAGE CONTAINER ===== */
.page {
    padding-top: 4.5rem;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===== PAGE HEADER ===== */
.page-header {
    text-align: center;
    padding: 3rem 0 2rem;
    background: linear-gradient(180deg, var(--cream) 0%, var(--cream-warm) 100%);
}

.page-header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 0.75rem;
}

.page-header h1 em {
    font-style: italic;
    color: var(--sage-dark);
}

.page-header p {
    font-size: 1.05rem;
    color: var(--text-light);
    max-width: 560px;
    margin: 0 auto 2rem;
}

/* ===== SEARCH BAR ===== */
.search-container {
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
}

.search-container input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3rem;
    border: 2px solid var(--stone);
    border-radius: 60px;
    font-size: 1rem;
    font-family: 'DM Sans', sans-serif;
    background: white;
    color: var(--text);
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
}

.search-container input:focus {
    border-color: var(--sage);
    box-shadow: 0 0 0 4px rgba(122, 139, 111, 0.12);
}

.search-container input::placeholder { color: #B0A899; }

.search-container .search-icon {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--sage);
}

/* ===== CEMETERY GRID ===== */
.cemetery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0 4rem;
}

.cemetery-card {
    background: white;
    border-radius: 16px;
    padding: 1.75rem;
    border: 1px solid var(--stone);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.cemetery-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.cemetery-card-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 0.5rem;
}

.cemetery-card-location {
    font-size: 0.85rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.cemetery-card-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}

.cemetery-card-notable {
    font-size: 0.8rem;
    color: var(--sage-dark);
    background: rgba(122, 139, 111, 0.08);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    line-height: 1.5;
}

.cemetery-card-notable strong {
    font-weight: 600;
    display: block;
    margin-bottom: 0.15rem;
}

.cemetery-card-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--stone);
}

.cemetery-card-meta span {
    font-size: 0.78rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ===== CEMETERY DETAIL ===== */
.cemetery-detail {
    padding: 3rem 0;
}

.cemetery-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.cemetery-detail-info h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 0.5rem;
}

.cemetery-detail-info .location {
    font-size: 1rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.detail-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--stone);
    margin-bottom: 1.5rem;
}

.detail-section h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 1rem;
}

.detail-section p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.7;
}

.notable-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.notable-tag {
    background: rgba(212, 168, 168, 0.15);
    color: var(--charcoal);
    padding: 0.35rem 0.8rem;
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 500;
}

.detail-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.detail-fact {
    text-align: center;
}

.detail-fact-num {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sage-dark);
}

.detail-fact-label {
    font-size: 0.78rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

/* ===== GRAVES & RECORDS TABLE ===== */
.graves-section {
    background: var(--cream-warm);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.graves-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.graves-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 700;
    font-style: italic;
    color: var(--charcoal);
    margin: 0;
}

.graves-search-wrap {
    position: relative;
    width: 240px;
}

.graves-search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.graves-search {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.4rem;
    border: 1px solid var(--stone);
    border-radius: 100px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--text);
    background: white;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.graves-search:focus {
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(122, 139, 111, 0.1);
}

.graves-search::placeholder {
    color: #B0A899;
}

.graves-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.graves-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.graves-th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sage-dark);
    border-bottom: 1px solid var(--stone);
    white-space: nowrap;
}

.graves-th-num {
    text-align: center;
}

.graves-row {
    transition: background 0.15s;
}

.graves-row-odd {
    background: rgba(212, 168, 168, 0.08);
}

.graves-row:hover {
    background: rgba(212, 168, 168, 0.15);
}

.graves-cell {
    padding: 0.85rem 1rem;
    color: var(--text);
    border-bottom: 1px solid rgba(232, 226, 216, 0.5);
    white-space: nowrap;
}

.graves-cell-name {
    font-weight: 600;
    color: var(--charcoal);
}

.graves-cell-num {
    text-align: center;
    color: var(--text-light);
}

.graves-count {
    padding-top: 0.85rem;
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

.graves-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .graves-section { padding: 1.25rem; }
    .graves-header { flex-direction: column; align-items: flex-start; }
    .graves-search-wrap { width: 100%; }
    .graves-th, .graves-cell { padding: 0.6rem 0.6rem; font-size: 0.8rem; }
    .graves-cell-name { min-width: 140px; }
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: 100px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--sage);
    color: white;
}

.btn-primary:hover {
    background: var(--sage-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(122, 139, 111, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--sage-dark);
    border: 2px solid var(--sage-light);
}

.btn-secondary:hover {
    background: rgba(122, 139, 111, 0.05);
    border-color: var(--sage);
}

.btn-petal {
    background: var(--petal);
    color: white;
}

.btn-petal:hover {
    background: #C09090;
    transform: translateY(-1px);
}

.btn-lg {
    padding: 1rem 2.25rem;
    font-size: 1.05rem;
}

/* ===== FORM STYLES ===== */
.form-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    border: 1px solid var(--stone);
    max-width: 640px;
    margin: 0 auto 4rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.45rem;
    letter-spacing: 0.01em;
}

.form-group label .required {
    color: var(--petal);
    margin-left: 0.15rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--stone);
    border-radius: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--text);
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(122, 139, 111, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B6B6B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2.5rem;
}

.form-group .hint {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 0.35rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-divider {
    border: none;
    border-top: 1px solid var(--stone);
    margin: 2rem 0;
}

.form-section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== ARRANGEMENT CARDS ===== */
/* Reset .form-group input styles for radio buttons inside arrangement cards */
.arrangement-option input[type="radio"] {
    width: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
    outline: none;
    flex-shrink: 0;
}

/* Reset .form-group label styles for arrangement-option labels */
.arrangement-option.arrangement-option {
    display: flex !important;
    flex-direction: column;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    margin-bottom: 0;
    letter-spacing: inherit;
}

/* ===== CONFIRMATION ===== */
.confirmation {
    text-align: center;
    padding: 5rem 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.confirmation-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.confirmation h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 1rem;
}

.confirmation p {
    font-size: 1.05rem;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.confirmation-details {
    background: rgba(122, 139, 111, 0.06);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: left;
    margin: 2rem 0;
}

.confirmation-details dt {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1rem;
}

.confirmation-details dt:first-child {
    margin-top: 0;
}

.confirmation-details dd {
    font-size: 0.95rem;
    color: var(--text);
    margin-top: 0.2rem;
}

/* ===== SEARCH RESULTS EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    color: var(--charcoal);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.95rem;
    color: var(--text-light);
}

/* ===== LOADING ===== */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--stone);
    border-top-color: var(--sage);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

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

/* ===== TOAST MESSAGES ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--charcoal);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 1000;
    transform: translateY(120%);
    transition: transform 0.3s ease;
    max-width: 380px;
}

.toast.show {
    transform: translateY(0);
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--error);
}

/* ===== FOOTER (APP) ===== */
.app-footer {
    padding: 2.5rem 2rem;
    background: var(--charcoal);
    text-align: center;
    margin-top: auto;
}

.app-footer .footer-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
}

.app-footer .footer-sub {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.2);
    margin-top: 0.5rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav { padding: 0.75rem 1rem; }
    .nav-links { gap: 0.75rem; }
    .nav-links a:not(.btn-nav) { display: none; }
    .container { padding: 0 1rem; }
    .cemetery-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .form-card { padding: 1.5rem; margin: 0 0.5rem 3rem; }
    .cemetery-detail-header { flex-direction: column; }
    .page-header { padding: 2rem 0 1.5rem; }
}

@media (max-width: 480px) {
    .page-header h1 { font-size: 1.5rem; }
    .detail-facts { grid-template-columns: repeat(2, 1fr); }
}
