:root {
    --bg-deep: #07070d;
    --bg-mid: #11121f;
    --gold: #e8c873;
    --gold-soft: #d4b35a;
    --gold-glow: rgba(232, 200, 115, 0.35);
    --text: #f3ecd8;
    --text-dim: #b9b09a;
    --text-mute: #6b6553;
    --error: #d97a7a;
    --serif: 'Cormorant Garamond', 'Georgia', serif;
    --display: 'Cinzel', 'Trajan Pro', serif;
}

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

html, body {
    min-height: 100vh;
    background: radial-gradient(ellipse at 50% 0%, #1a1830 0%, var(--bg-deep) 60%);
    color: var(--text);
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.6;
    overflow-x: hidden;
}

body {
    position: relative;
}

/* === Fondo de estrellas === */
.stars {
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 80% 70%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1.2px 1.2px at 40% 80%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 90% 20%, rgba(232,200,115,0.4), transparent),
        radial-gradient(1.5px 1.5px at 15% 60%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 60% 10%, rgba(232,200,115,0.5), transparent),
        radial-gradient(1px 1px at 70% 50%, rgba(255,255,255,0.4), transparent),
        radial-gradient(1.2px 1.2px at 30% 15%, rgba(255,255,255,0.5), transparent);
    background-size: 100% 100%;
    pointer-events: none;
    z-index: 0;
    animation: twinkle 6s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.halo {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, var(--gold-glow) 0%, transparent 60%);
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
    animation: halo-pulse 8s ease-in-out infinite;
}

/* Imagen de Jesús de fondo (Sagrado Corazón - Batoni 1767, dominio público) */
.jesus-bg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(85vw, 520px);
    height: 100vh;
    background-image: url('../images/jesus.jpg');
    background-repeat: no-repeat;
    background-position: center 4%;
    background-size: contain;
    opacity: 0.22;
    pointer-events: none;
    z-index: 0;
    filter: blur(0.6px) saturate(1.05);
    -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,1) 10%, rgba(0,0,0,1) 60%, rgba(0,0,0,0) 92%);
            mask-image: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,1) 10%, rgba(0,0,0,1) 60%, rgba(0,0,0,0) 92%);
    animation: jesus-breathe 9s ease-in-out infinite;
}

@keyframes jesus-breathe {
    0%, 100% { opacity: 0.20; }
    50%      { opacity: 0.28; }
}

@keyframes halo-pulse {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

/* === Layout === */
.container {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 4rem 1.5rem 3rem;
}

/* === Hero === */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    animation: fade-in 1.4s ease-out;
}

.cross {
    width: 32px;
    height: 48px;
    margin: 0 auto 1.5rem;
    position: relative;
    filter: drop-shadow(0 0 12px var(--gold-glow));
}

.cross-v, .cross-h {
    position: absolute;
    background: linear-gradient(180deg, var(--gold) 0%, var(--gold-soft) 100%);
    border-radius: 1px;
}

.cross-v {
    width: 3px;
    height: 48px;
    left: 50%;
    transform: translateX(-50%);
}

.cross-h {
    width: 22px;
    height: 3px;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
}

.title {
    font-family: var(--display);
    font-size: clamp(2rem, 6vw, 3.4rem);
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--gold);
    text-shadow: 0 0 30px var(--gold-glow);
    margin-bottom: 0.6rem;
}

.subtitle {
    font-style: italic;
    font-size: 1.15rem;
    color: var(--text-dim);
    letter-spacing: 0.02em;
}

/* === Versículo aleatorio === */
.verse-card {
    background: linear-gradient(180deg, rgba(232,200,115,0.06), rgba(232,200,115,0.02));
    border: 1px solid rgba(232,200,115,0.15);
    border-radius: 4px;
    padding: 2rem 1.8rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    animation: fade-in 1.6s ease-out 0.3s both;
}

.verse-card::before,
.verse-card::after {
    content: '✦';
    position: absolute;
    color: var(--gold);
    font-size: 0.9rem;
    opacity: 0.6;
}

.verse-card::before { top: 8px; left: 12px; }
.verse-card::after  { bottom: 8px; right: 12px; }

.verse-text {
    font-size: 1.25rem;
    font-style: italic;
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 0.8rem;
    transition: opacity 0.6s ease;
}

.verse-ref {
    font-family: var(--display);
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    color: var(--gold-soft);
    text-transform: uppercase;
    transition: opacity 0.6s ease;
}

.verse-text.fading,
.verse-ref.fading {
    opacity: 0;
}

/* === Mensaje introductorio === */
.intro-message {
    text-align: center;
    margin: 0 auto 3rem;
    max-width: 600px;
    color: var(--text-dim);
    font-size: 1.05rem;
    line-height: 1.8;
    animation: fade-in 1.6s ease-out 0.4s both;
}

.intro-message p {
    margin-bottom: 1.1rem;
}

.intro-message p:last-child {
    margin-bottom: 0;
}

.intro-lead {
    font-family: var(--display);
    font-size: 1.25rem !important;
    color: var(--gold-soft);
    letter-spacing: 0.04em;
    margin-bottom: 1.5rem !important;
    line-height: 1.5;
}

.intro-note {
    font-size: 0.9rem !important;
    color: var(--text-mute);
    font-style: italic;
    padding-top: 1.2rem;
    margin-top: 1.5rem !important;
    border-top: 1px solid rgba(232,200,115,0.12);
    line-height: 1.6;
}

/* === Confesión === */
.confession {
    margin-bottom: 2rem;
    animation: fade-in 1.6s ease-out 0.5s both;
}

.label {
    display: block;
    font-family: var(--display);
    font-size: 0.95rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold-soft);
    text-align: center;
    margin-bottom: 1.2rem;
}

.sin-input {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(232,200,115,0.2);
    border-radius: 4px;
    padding: 1.2rem 1.4rem;
    font-family: var(--serif);
    font-size: 1.15rem;
    color: var(--text);
    line-height: 1.6;
    resize: vertical;
    min-height: 130px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.sin-input::placeholder {
    color: var(--text-mute);
    font-style: italic;
}

.sin-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(232,200,115,0.12), 0 0 25px rgba(232,200,115,0.15);
}

/* === Checkbox de consentimiento === */
.consent {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin-top: 1.2rem;
    padding: 1rem 1.1rem;
    background: rgba(232,200,115,0.04);
    border: 1px solid rgba(232,200,115,0.12);
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.consent:hover {
    border-color: rgba(232,200,115,0.25);
    background: rgba(232,200,115,0.06);
}

.consent input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 3px;
    border: 1px solid var(--gold-soft);
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.consent input[type="checkbox"]:checked {
    background: var(--gold);
    border-color: var(--gold);
}

.consent input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid var(--bg-deep);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.consent-text {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text-dim);
    flex: 1;
}

.consent-text strong { color: var(--text); }

.consent-text a {
    color: var(--gold-soft);
    text-decoration: underline;
    text-decoration-color: rgba(232,200,115,0.4);
    text-underline-offset: 2px;
}

.consent-text a:hover { color: var(--gold); }

.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.2rem;
    gap: 1rem;
}

.char-count {
    font-size: 0.85rem;
    color: var(--text-mute);
    letter-spacing: 0.05em;
}

.submit-btn {
    position: relative;
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-family: var(--display);
    font-size: 0.95rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 0.9rem 2.2rem;
    cursor: pointer;
    transition: all 0.4s ease;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(232,200,115,0.25), transparent);
    transition: left 0.6s ease;
}

.submit-btn:hover::before { left: 100%; }

.submit-btn:hover {
    background: rgba(232,200,115,0.08);
    box-shadow: 0 0 25px var(--gold-glow);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.submit-btn.loading .btn-text { opacity: 0.4; }

.btn-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(232,200,115,0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    opacity: 0;
    animation: spin 0.9s linear infinite;
}

.submit-btn.loading .btn-spinner { opacity: 1; }

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

.disclaimer {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-mute);
    text-align: center;
    line-height: 1.5;
    font-style: italic;
}

/* === Respuesta === */
.response-section {
    position: relative;
    margin-top: 2rem;
    animation: rise-in 1.2s ease-out;
}

@keyframes rise-in {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.divine-light {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 200px;
    background: radial-gradient(ellipse, var(--gold-glow) 0%, transparent 70%);
    filter: blur(30px);
    pointer-events: none;
    animation: light-fall 2s ease-out;
    z-index: -1;
}

@keyframes light-fall {
    from { opacity: 0; transform: translateX(-50%) scale(0.5); }
    to   { opacity: 1; transform: translateX(-50%) scale(1); }
}

.response-card {
    background: linear-gradient(180deg, rgba(232,200,115,0.05), rgba(232,200,115,0.01));
    border: 1px solid rgba(232,200,115,0.18);
    border-left: 3px solid var(--gold);
    padding: 2rem 1.8rem;
    margin-bottom: 1.5rem;
    border-radius: 2px;
}

.response-title {
    font-family: var(--display);
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1rem;
}

.response-text {
    font-size: 1.2rem;
    line-height: 1.75;
    color: var(--text);
    white-space: pre-wrap;
}

.prayer-card .response-text {
    font-style: italic;
}

/* === Penitencia === */
.penance-card {
    border-left-color: var(--gold-soft);
}

.penance-intro {
    font-size: 1.05rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.penance-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.penance-item {
    font-family: var(--display);
    font-size: 1.05rem;
    letter-spacing: 0.05em;
    color: var(--text);
    padding: 0.7rem 1rem;
    background: rgba(232,200,115,0.06);
    border-left: 2px solid var(--gold);
    border-radius: 2px;
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
}

.penance-num {
    font-family: var(--display);
    font-weight: 700;
    color: var(--gold);
    font-size: 1.4rem;
    min-width: 1.6em;
    text-align: right;
}

.restart-btn {
    display: block;
    margin: 2rem auto 0;
    background: transparent;
    border: 1px solid rgba(232,200,115,0.4);
    color: var(--gold-soft);
    font-family: var(--display);
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 0.8rem 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.restart-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(232,200,115,0.06);
}

/* === Error === */
.error-section {
    text-align: center;
    padding: 2rem;
    background: rgba(217,122,122,0.06);
    border: 1px solid rgba(217,122,122,0.2);
    border-radius: 4px;
    margin-top: 2rem;
}

.error-text {
    color: var(--error);
    margin-bottom: 1rem;
    font-style: italic;
}

/* === Footer === */
.footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(232,200,115,0.12);
    text-align: center;
    font-size: 0.95rem;
    font-style: italic;
    color: var(--text-mute);
}

.footer-links {
    margin-top: 0.8rem;
    font-style: normal;
    font-size: 0.85rem;
}

.footer-links a {
    color: var(--text-mute);
    text-decoration: none;
    border-bottom: 1px solid rgba(232,200,115,0.2);
    padding-bottom: 1px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.footer-links a:hover {
    color: var(--gold-soft);
    border-color: var(--gold-soft);
}

/* === Animaciones === */
@keyframes fade-in {
    from { opacity: 0; transform: translateY(15px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* === Responsive === */
@media (max-width: 600px) {
    html, body { font-size: 16px; }
    .container { padding: 2.5rem 1rem 2rem; }
    .verse-card { padding: 1.5rem 1.2rem; }
    .response-card { padding: 1.5rem 1.2rem; }
    .meta-row { flex-direction: column; align-items: stretch; }
    .submit-btn { width: 100%; }
}
