/* =====================================================================
   CMI LifeTech — Unified Components (Cathedral of Uncreated Light)
   ===================================================================== */

/* ── 1. Sacred Threshold (App Header) ────────────────────── */
.app-header {
    text-align: center;
    margin-top: 24px;
    margin-bottom: 32px;
    position: relative;
    z-index: 20;
}

.header-logo-wrap {
    display: inline-block;
    position: relative;
    margin-bottom: 16px;
    padding: 6px;
    border-radius: var(--radius-full);
    background: radial-gradient(circle, rgba(226, 186, 77, 0.15) 0%, transparent 70%);
}

.header-logo-wrap::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-gold);
    pointer-events: none;
    opacity: 0.6;
}

.header-logo {
    display: block;
    width: 88px;
    height: 88px;
    border-radius: var(--radius-full);
    border: 2px solid var(--holy-gold);
    box-shadow: 0 0 35px var(--holy-gold-glow), inset 0 0 12px rgba(0, 0, 0, 0.4);
    object-fit: cover;
    transition: var(--transition-processional);
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}
.header-logo:hover {
    transform: scale(1.04);
    box-shadow: 0 0 50px var(--holy-gold-bright);
}

.main-title {
    font-family: var(--font-gothic-deco);
    font-size: clamp(2.5rem, 6.5vw, 4.2rem);
    color: var(--holy-dark);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: 0.14em;
    position: relative;
    display: inline-block;
    transition: var(--transition-processional);
    text-transform: uppercase;
}
body.dark-theme .main-title {
    color: var(--holy-gold-bright);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 40px rgba(226, 186, 77, 0.35);
}

.nave-purpose {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.98rem;
    line-height: 1.6;
    max-width: 34em;
    margin: 0 auto 18px;
    padding: 0 12px;
}
.sub-title {
    font-family: var(--font-holy);
    font-size: clamp(0.78rem, 1.8vw, 0.98rem);
    color: var(--holy-gold);
    letter-spacing: 0.36em;
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 10px;
    opacity: 0.92;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.sub-title::before, .sub-title::after {
    content: '❖';
    font-size: 0.65rem;
    opacity: 0.7;
    color: var(--holy-gold);
}

/* Vestry Shelf (Utility Controls) */
.vestry-utility-shelf {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.lang-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-engraved);
    color: var(--text-muted);
    font-family: var(--font-holy);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
}
.lang-btn:hover {
    color: var(--holy-gold);
    border-color: var(--border-gold);
    background: rgba(226, 186, 77, 0.06);
}

/* ── 2. Rood Screen (5-Chapel Navigation) ────────────────── */
nav.main-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 36px;
    position: sticky;
    top: 12px;
    z-index: 100;
}

.nav-container {
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-full);
    padding: 6px 10px;
    box-shadow: var(--shadow-holy), 0 0 20px rgba(0, 0, 0, 0.4);
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.nav-container::-webkit-scrollbar {
    display: none;
}

.nav-wrap {
    display: flex;
    gap: 6px;
    align-items: center;
}

.nt {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-holy);
    font-size: 0.96rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-processional);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    position: relative;
    min-height: 44px;
}
.nt i {
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: transform 0.3s ease, color 0.3s ease;
}
.nt:hover {
    color: var(--holy-gold);
    background: rgba(226, 186, 77, 0.06);
}
.nt:hover i {
    color: var(--holy-gold);
}
.nt.on {
    color: #1a1208;
    background: linear-gradient(135deg, var(--holy-gold-deep) 0%, var(--holy-gold) 60%, var(--holy-gold-bright) 100%);
    border-color: var(--border-gold);
    box-shadow: 0 4px 22px var(--holy-gold-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    font-weight: 700;
}
.nt.on i {
    color: #1a1208;
    transform: scale(1.12);
}
.nt.on::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 25%;
    width: 50%;
    height: 2px;
    background: #1a1208;
    border-radius: var(--radius-full);
    opacity: 0.45;
}

.nav-sep {
    width: 1px;
    height: 22px;
    background: var(--border-subtle);
    margin: 0 6px;
}

.nav-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn-holy {
    position: relative;
    background: linear-gradient(135deg, var(--holy-gold) 0%, var(--holy-gold-bright) 100%);
    color: #1a1208;
    border: none;
    border-radius: var(--radius-full);
    padding: 12px 28px;
    font-family: var(--font-holy);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 6px 20px var(--holy-gold-glow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    outline: none;
}
.btn-holy:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(232, 155, 81, 0.5);
    filter: brightness(1.06);
}
.btn-holy:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}
.btn-holy:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.6);
}

.btn-holy.dark {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-gold);
    box-shadow: none;
}
.btn-holy.dark:hover:not(:disabled) {
    background: rgba(197, 155, 39, 0.12);
    border-color: var(--holy-gold);
    color: var(--holy-gold-bright);
}

.btn-holy.sm {
    padding: 7px 16px;
    font-size: 0.88rem;
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--border-gold);
    color: var(--text-primary);
    border-radius: var(--radius-full);
    padding: 8px 14px;
    min-height: 44px;
    font-family: var(--font-holy);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.lang-btn:hover {
    background: rgba(197, 155, 39, 0.12);
    color: var(--holy-gold-bright);
    border-color: var(--holy-gold-bright);
}

/* ── Panel Foundation (entry animation lives in animations.css on .pn.on) ─ */
.pn {
    display: none;
    min-height: 60vh;
}
.pn.on {
    display: block;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-holy);
    position: relative;
    transition: var(--transition-smooth);
}
.glass-card:hover {
    border-color: var(--holy-gold);
}

/* ── Input Fields ───────────────────────────────────────── */
.fm-in, .setup-form-input, .setup-form-textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.98rem;
    line-height: 1.6;
    outline: none;
    transition: var(--transition-smooth);
}
.fm-in:focus, .setup-form-input:focus, .setup-form-textarea:focus {
    border-color: var(--holy-gold-bright);
    box-shadow: 0 0 16px var(--holy-gold-glow);
}
.setup-form-textarea {
    resize: vertical;
    min-height: 110px;
}

/* ── 4. Sanctuary Lamp (Floating Audio Dock) ─────────────── */
.audio-floating-deck {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 1000;
    background: var(--card-bg-elevated);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-gold);
    border-radius: 28px;
    padding: 8px 14px 8px 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 18px var(--holy-gold-glow);
    transition: var(--transition-processional);
    max-width: min(640px, calc(100vw - 48px));
}
.audio-floating-deck::before {
    content: '🪔';
    font-size: 0.95rem;
    margin-left: 4px;
    opacity: 0.85;
    filter: drop-shadow(0 0 6px var(--holy-gold-bright));
}
.audio-min-btn {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 1px solid var(--holy-gold);
    background: rgba(226, 186, 77, 0.12);
    color: var(--holy-gold-bright);
    cursor: pointer;
    font-size: 0.85rem;
}
.audio-min-btn:focus-visible {
    outline: 2px solid var(--holy-gold-bright);
    outline-offset: 2px;
}
.audio-floating-deck.minimized {
    width: 56px;
    min-width: 56px;
    max-width: 56px;
    height: 56px;
    padding: 0;
    gap: 0;
    right: auto;
    border-radius: 50%;
    justify-content: center;
}
.audio-floating-deck.minimized::before,
.audio-floating-deck.minimized > :not(.audio-min-btn) {
    display: none;
}
.audio-floating-deck.minimized .audio-min-btn {
    width: 56px;
    height: 56px;
    border: none;
    background: transparent;
    font-size: 1.15rem;
}
.audio-floating-deck.playing {
    border-color: var(--holy-gold-bright);
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55), 0 0 35px var(--holy-gold-glow);
    animation: sanctuaryLampPulse 4s infinite ease-in-out;
}

@keyframes sanctuaryLampPulse {
    0%, 100% {
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 16px var(--holy-gold-glow);
    }
    50% {
        box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55), 0 0 32px rgba(226, 186, 77, 0.45);
    }
}

.audio-deck-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.audio-toggle-btn, .audio-stop-btn {
    padding: 8px 14px !important;
    font-size: 0.82rem !important;
    min-height: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-family: var(--font-holy);
    font-weight: 700;
    letter-spacing: 0.05em;
    touch-action: manipulation;
}
.audio-toggle-btn *, .audio-stop-btn * {
    pointer-events: none;
}
.audio-toggle-btn:active {
    transform: scale(0.94) !important;
}
.audio-stop-btn {
    background: rgba(196, 104, 22, 0.12) !important;
    border: 1px solid rgba(196, 104, 22, 0.4) !important;
    color: var(--holy-amber) !important;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    transition: transform 0.2s ease, background 0.25s ease, box-shadow 0.25s ease;
}
body.dark-theme .audio-stop-btn {
    background: rgba(232, 155, 81, 0.16) !important;
    border-color: rgba(232, 155, 81, 0.45) !important;
    color: var(--holy-gold-bright) !important;
}
.audio-stop-btn:hover {
    background: var(--holy-amber) !important;
    border-color: var(--holy-gold-bright) !important;
    color: #ffffff !important;
    box-shadow: 0 0 14px rgba(232, 155, 81, 0.4);
}
.audio-stop-btn:active, .audio-stop-btn.active-flash {
    background: var(--holy-gold-deep) !important;
    border-color: var(--holy-gold-bright) !important;
    color: #ffffff !important;
    transform: scale(0.92) !important;
    box-shadow: 0 0 18px var(--holy-gold-glow) !important;
}

.audio-controls-full {
    display: flex;
    align-items: center;
    gap: 12px;
}
.audio-visualizer-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 18px;
}
.visualizer-bar {
    width: 3px;
    height: 4px;
    background: var(--holy-gold);
    border-radius: 2px;
    transition: height 0.18s ease;
}
.audio-track-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.25;
    flex: 1 1 260px;
}
.audio-track-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.audio-track-choice {
    appearance: none;
    border: 1px solid var(--holy-gold);
    background: rgba(226, 186, 77, 0.08);
    color: var(--holy-gold-bright);
    border-radius: var(--radius-full);
    padding: 8px 14px;
    min-height: 40px;
    font-family: var(--font-holy);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    line-height: 1.2;
}
.audio-track-choice[aria-pressed="true"] {
    background: var(--holy-gold-bright);
    color: #1a1208;
    border-color: #fff6d2;
    box-shadow: 0 0 18px var(--holy-gold-glow);
}
.audio-track-choice:focus-visible {
    outline: 2px solid var(--holy-gold-bright);
    outline-offset: 2px;
}
body:not(.dark-theme) .audio-track-choice {
    color: var(--holy-dark);
    border-color: var(--holy-gold-deep);
}
body:not(.dark-theme) .audio-track-choice[aria-pressed="true"] {
    background: var(--holy-gold-deep);
    color: #fffaf0;
}
.audio-track-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.audio-volume-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--holy-gold);
    font-size: 0.78rem;
}
.audio-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 60px;
    height: 4px;
    background: rgba(226, 186, 77, 0.25);
    border-radius: var(--radius-full);
    outline: none;
}
.audio-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--holy-gold-bright);
    cursor: pointer;
    box-shadow: 0 0 6px var(--holy-gold-glow);
}

/* ── 5. Acolyte Whisper Toast ────────────────────────────── */
#soft-toast-container {
    position: fixed;
    bottom: 88px;
    right: 28px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 420px;
}
.soft-toast {
    pointer-events: auto;
    background: var(--card-bg-elevated);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-gold);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.5), 0 0 25px var(--holy-gold-glow);
    font-family: var(--font-holy);
    font-size: 0.94rem;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: acolyteWhisperIn 0.42s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 3px solid var(--holy-gold-bright);
}
@keyframes acolyteWhisperIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ── 6. Terms of Use: Illuminated Charter Modal ─────────── */
.holy-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 2, 6, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}
.holy-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}
.holy-modal-box {
    background: var(--card-bg-elevated);
    border: 2px solid var(--border-gold);
    border-radius: var(--radius-lg);
    box-shadow: 0 35px 85px rgba(0, 0, 0, 0.9), 0 0 60px var(--holy-gold-glow);
    max-width: 680px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 40px 36px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}
.holy-modal-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--holy-gold), var(--holy-gold-bright), transparent);
}
.holy-modal-overlay.open .holy-modal-box {
    transform: scale(1);
}
.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 1.15rem;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.modal-close-btn:hover {
    color: var(--holy-gold-bright);
    border-color: var(--holy-gold);
    background: rgba(226, 186, 77, 0.08);
}

/* ── Anti-Jump Layout Stabilization ───────────────────────── */
.lexicon-grid {
    min-height: 280px;
}
#prayer-board-grid {
    min-height: 240px;
}
#eternity-cards-grid {
    min-height: 240px;
}
.manna-card {
    min-height: 200px;
}

/* ── CMI Bible Study Group Invitation ────────────────────── */
.bible-study-invite {
    max-width: 760px;
    margin: 48px auto 0;
    padding: 0 8px;
}
.bible-study-invite-inner {
    text-align: center;
    background: var(--card-bg-elevated);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: 36px 28px 32px;
    box-shadow: var(--shadow-holy), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    position: relative;
}
.bible-study-invite-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 1px;
    background: radial-gradient(circle, var(--holy-gold-bright) 0%, transparent 80%);
}
.bible-study-kicker {
    font-family: var(--font-holy);
    font-size: 0.78rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--holy-gold);
    margin-bottom: 10px;
    font-weight: 700;
}
.bible-study-title {
    font-family: var(--font-holy);
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    color: var(--holy-gold-bright);
    font-weight: 700;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}
.bible-study-desc {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto 22px;
}
.bible-study-join-btn {
    min-height: 44px;
    text-decoration: none;
}
.footer-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

/* ── Site Footer ─────────────────────────────────────────── */
.app-footer {
    margin: 48px auto 24px;
    max-width: 720px;
    text-align: center;
    padding: 28px 16px 12px;
    border-top: 1px solid var(--border-gold);
    color: var(--text-muted);
}
.footer-org {
    font-family: var(--font-holy);
    color: var(--holy-gold);
    font-weight: 700;
    letter-spacing: 0.18em;
    font-size: 0.88rem;
}
.footer-copy {
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
}
.footer-disclaimer-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    background: transparent;
    border: 1px solid var(--border-gold);
    color: var(--holy-gold);
    font-family: var(--font-holy);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 10px 18px;
    min-height: 44px;
    border-radius: var(--radius-full);
    cursor: pointer;
    text-decoration: none;
}
.footer-disclaimer-link:hover {
    background: rgba(226, 186, 77, 0.12);
    color: var(--holy-gold-bright);
}
.disclaimer-heading {
    font-family: var(--font-holy);
    color: var(--holy-gold);
    text-align: center;
    margin: 8px 28px 18px;
    font-size: 1.35rem;
}
.disclaimer-body {
    font-size: 0.95rem;
    line-height: 1.85;
    color: var(--text-secondary);
}

