/* Mi Cuaderno de Oración — Prototipo v1 */

:root {
    --cream: #f7f3ec;
    --white-warm: #fffdf9;
    --blue-deep: #1e3a5f;
    --blue-soft: #2f4f73;
    --gold: #b8956a;
    --gold-light: #d4bc94;
    --text: #2c3e50;
    --text-muted: #5c6b7a;
    --border: #e4ddd2;
    --shadow: rgba(30, 58, 95, 0.06);
    --font-serif: 'Crimson Pro', Georgia, serif;
    --font-sans: 'Source Sans 3', system-ui, sans-serif;
    --sidebar-width: 220px;
    --header-height: 60px;
    --mobile-nav-height: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--cream);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--blue-deep);
    margin: 0 0 0.5rem;
}

a { color: var(--blue-soft); text-decoration: none; }
a:hover { color: var(--blue-deep); }

.container {
    width: min(960px, calc(100% - 2rem));
    margin: 0 auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.btn--primary { background: var(--blue-deep); color: #fff; }
.btn--primary:hover { background: var(--blue-soft); color: #fff; }
.btn--secondary { background: var(--white-warm); color: var(--blue-deep); border-color: var(--border); }
.btn--secondary:hover { border-color: var(--gold-light); color: var(--blue-deep); }
.btn--sm { min-height: 40px; padding: 0.5rem 1.25rem; font-size: 0.95rem; }
.btn--block { width: 100%; }

/* Brand */
.brand {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--blue-deep);
    text-decoration: none;
}

.brand:hover { color: var(--blue-deep); }

/* Header */
.site-header {
    background: rgba(247, 243, 236, 0.95);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner,
.header-private-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
    padding: 0 1rem;
}

.site-header--private {
    background: var(--white-warm);
    border-bottom: 1px solid var(--border);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--blue-deep);
    border-radius: 2px;
}

/* Welcome */
.page-public {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(180deg, #faf7f2 0%, var(--cream) 48%, #f4f0e9 100%);
}

.welcome {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0 3rem;
}

.welcome__inner {
    text-align: center;
    max-width: 560px;
}

/* Calendario litúrgico — colores y acentos por temporada (lógica pendiente en PHP) */
.welcome[data-liturgical-season="ordinario"] {
    --welcome-accent: var(--gold);
    --welcome-accent-light: var(--gold-light);
    --welcome-bg-glow: rgba(184, 149, 106, 0.08);
}

.welcome[data-liturgical-season="adviento"] {
    --welcome-accent: #4a5568;
    --welcome-accent-light: #718096;
    --welcome-bg-glow: rgba(74, 85, 104, 0.08);
}

.welcome[data-liturgical-season="navidad"] {
    --welcome-accent: #c9a227;
    --welcome-accent-light: #e8d48b;
    --welcome-bg-glow: rgba(201, 162, 39, 0.1);
}

.welcome[data-liturgical-season="cuaresma"] {
    --welcome-accent: #6b5b4f;
    --welcome-accent-light: #9a8575;
    --welcome-bg-glow: rgba(107, 91, 79, 0.08);
}

.welcome[data-liturgical-season="pascua"] {
    --welcome-accent: #fff;
    --welcome-accent-light: #f0e6d3;
    --welcome-bg-glow: rgba(255, 255, 255, 0.15);
}

.welcome[data-liturgical-season="pentecostes"] {
    --welcome-accent: #c0392b;
    --welcome-accent-light: #e74c3c;
    --welcome-bg-glow: rgba(192, 57, 43, 0.08);
}

.welcome {
    --welcome-accent: var(--gold);
    --welcome-accent-light: var(--gold-light);
    --welcome-bg-glow: rgba(184, 149, 106, 0.05);
    background: radial-gradient(ellipse at 50% 30%, var(--welcome-bg-glow), transparent 65%);
}

.welcome__symbol {
    display: inline-block;
    width: 1px;
    height: 28px;
    background: var(--welcome-accent);
    margin-bottom: 0.75rem;
    position: relative;
    opacity: 0.7;
}

.welcome__symbol::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 18px;
    height: 1px;
    background: var(--welcome-accent);
    transform: translateX(-50%);
}

.welcome__identity {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: none;
    color: var(--text-muted);
    margin: 0 0 1.75rem;
    opacity: 0.85;
}

.welcome__title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.welcome__subtitle {
    font-family: var(--font-serif);
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    font-weight: 400;
    line-height: 1.7;
    color: var(--text-muted);
    margin: 0 auto 2.5rem;
    max-width: 480px;
    letter-spacing: 0.01em;
}

.btn--welcome {
    min-height: 50px;
    min-width: 260px;
    padding: 0.75rem 2.75rem;
    font-size: 1.05rem;
    background: var(--blue-deep);
}

.btn--welcome:hover {
    background: var(--blue-soft);
}

.site-footer--welcome {
    margin-top: 0;
    padding: 2rem 0;
    border-top: none;
}

.site-footer--welcome p {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* Auth */
.page-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
    background: linear-gradient(180deg, #faf7f2 0%, var(--cream) 48%, #f4f0e9 100%);
}

.auth-page {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
}

.auth-card {
    width: min(420px, 100%);
    background: var(--white-warm);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: 0 8px 32px var(--shadow);
}

.auth-card--onboarding {
    text-align: center;
}

.auth-card__identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-serif);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 0 0 1.75rem;
    opacity: 0.85;
}

.auth-card__symbol {
    display: inline-block;
    width: 1px;
    height: 22px;
    background: var(--gold);
    position: relative;
    opacity: 0.7;
}

.auth-card__symbol::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    width: 14px;
    height: 1px;
    background: var(--gold);
    transform: translateX(-50%);
}

.auth-card h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.auth-card__subtitle {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    color: var(--text-muted);
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

.auth-card__message {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 2rem;
}

.form-field { margin-bottom: 1.25rem; }

.form-field label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--blue-deep);
}

.form-field input {
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 1rem;
    background: #fff;
    color: var(--text);
}

.form-field input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184, 149, 106, 0.15);
}

.form-checks {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
}

.form-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--blue-deep);
    cursor: pointer;
}

.auth-link {
    display: inline-block;
    font-size: 0.9rem;
    color: var(--blue-soft);
    margin-bottom: 1.25rem;
}

.auth-link:hover { color: var(--blue-deep); }

.auth-link--center {
    display: block;
    text-align: center;
    margin-bottom: 0;
}

.btn--auth {
    min-height: 50px;
    font-size: 1rem;
}

.auth-note {
    margin: 1.25rem 0 0;
    font-size: 0.85rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

.auth-notice {
    margin: 1.25rem 0 0;
    font-size: 0.85rem;
    text-align: center;
    color: var(--text-muted);
    line-height: 1.5;
}

.auth-divider {
    margin-top: 1.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.auth-divider p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0 0 1rem;
}

.auth-switch {
    margin: 1.5rem 0 0;
}

.form-error {
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: 10px;
    background: #fdf6f0;
    border: 1px solid #e8ddd2;
    color: var(--blue-deep);
    font-size: 0.9rem;
    line-height: 1.5;
}

.form-success {
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: 10px;
    background: #f0f4f0;
    border: 1px solid #dce5dc;
    color: var(--blue-deep);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Mi primera oración — recorrido guiado */
.page-oracion {
    min-height: 100vh;
    background: linear-gradient(180deg, #faf7f2 0%, var(--cream) 48%, #f4f0e9 100%);
}

.oracion-flow {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
}

.oracion-flow__inner {
    width: min(520px, 100%);
    text-align: center;
}

.oracion-flow__inner--centered {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.oracion-flow__title {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    margin-bottom: 2rem;
    line-height: 1.35;
}

.oracion-flow__text {
    font-family: var(--font-serif);
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 2.5rem;
}

.oracion-flow__text p {
    margin: 0 0 0.5rem;
}

.oracion-flow__text--spaced p {
    margin-bottom: 1rem;
}

.oracion-flow__intro,
.oracion-flow__question {
    font-family: var(--font-serif);
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 1rem;
}

.oracion-flow__question {
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
}

.oracion-flow__cross {
    display: inline-block;
    width: 1px;
    height: 48px;
    background: var(--gold);
    margin: 1rem 0 2rem;
    position: relative;
    opacity: 0.6;
}

.oracion-flow__cross::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    width: 32px;
    height: 1px;
    background: var(--gold);
    transform: translateX(-50%);
}

.oracion-flow__timer {
    margin-bottom: 2.5rem;
}

.oracion-flow__timer-display {
    margin: 1rem 0 0;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--text-muted);
    font-style: italic;
}

.oracion-flow__verse {
    margin: 0 0 2rem;
    padding: 0;
    border: none;
}

.oracion-flow__verse p {
    font-family: var(--font-serif);
    font-size: clamp(1.15rem, 2.5vw, 1.4rem);
    font-style: italic;
    color: var(--blue-deep);
    line-height: 1.6;
    margin: 0 0 0.75rem;
}

.oracion-flow__verse cite {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-style: normal;
    color: var(--text-muted);
}

.oracion-flow__label {
    display: block;
    text-align: left;
    font-size: 0.95rem;
    color: var(--blue-deep);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.oracion-flow__field {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    background: var(--white-warm);
    color: var(--text);
    margin-bottom: 2rem;
}

.oracion-flow__field--large {
    min-height: 160px;
}

.oracion-flow__field:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184, 149, 106, 0.12);
}

.oracion-flow__actions {
    margin-top: 0.5rem;
}

.btn--oracion {
    min-width: 220px;
    min-height: 50px;
    padding: 0.75rem 2rem;
}

.btn--oracion-sm {
    min-height: 44px;
    padding: 0.625rem 1.5rem;
    font-size: 0.95rem;
}

.oracion-flow--silence .oracion-flow__title {
    margin-bottom: 1rem;
}

.oracion-flow--final .oracion-flow__text {
    margin-bottom: 2.5rem;
}


/* App shell */
.app-shell { display: flex; min-height: 100vh; }
.app-shell__main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--white-warm);
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0.75rem;
    gap: 0.25rem;
}

.sidebar__link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: var(--text-muted);
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.sidebar__link:hover {
    background: var(--cream);
    color: var(--blue-deep);
}

.sidebar__link.is-active {
    background: #e8ede9;
    color: var(--blue-deep);
}

.sidebar-backdrop { display: none; }

/* Page content */
.page-main {
    flex: 1;
    padding: 2rem 1.5rem calc(2rem + var(--mobile-nav-height));
}

.page-content {
    width: min(800px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.page-content--centered {
    justify-content: center;
    min-height: calc(100vh - var(--header-height) - var(--mobile-nav-height) - 4rem);
}

/* Greeting */
.greeting__date {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.greeting h1 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
}

.greeting__verse {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--text-muted);
    margin: 0;
}

/* Cards */
.card {
    background: var(--white-warm);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px var(--shadow);
}

.card--prompt h2 { font-size: 1.25rem; margin-bottom: 1rem; }

.card--prompt textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 1rem;
    resize: vertical;
    min-height: 80px;
    background: #fff;
}

.card--prompt textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184, 149, 106, 0.12);
}

.card--placeholder {
    text-align: center;
    padding: 3rem 2rem;
}

.card--placeholder p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Blocks grid */
.blocks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.block-card__title {
    font-size: 1.1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.75rem;
}

.block-card__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.block-card__list li { border-bottom: 1px solid var(--border); }
.block-card__list li:last-child { border-bottom: none; }

.block-card__link {
    display: block;
    padding: 0.75rem 0;
    color: var(--blue-deep);
    font-weight: 500;
}

.block-card__link:hover { color: var(--gold); }

/* Mobile nav */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: var(--white-warm);
    border-top: 1px solid var(--border);
    padding: 0.5rem;
    justify-content: space-around;
    box-shadow: 0 -4px 20px var(--shadow);
}

.mobile-nav__link {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    border-radius: 8px;
}

.mobile-nav__link.is-active {
    color: var(--blue-deep);
    background: #e8ede9;
}

/* Footer */
.site-footer {
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.site-footer p {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.2s;
        box-shadow: 4px 0 24px var(--shadow);
    }

    .sidebar.is-open { transform: translateX(0); }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 150;
        background: rgba(30, 58, 95, 0.2);
    }

    .sidebar-backdrop:not([hidden]) { display: block; }

    .mobile-nav { display: flex; }

    .blocks-grid { grid-template-columns: 1fr; }

    .brand--compact { font-size: 0.95rem; }
}

@media (max-width: 480px) {
    .page-main { padding: 1.5rem 1rem calc(1.5rem + var(--mobile-nav-height)); }
    .auth-card { padding: 2rem 1.25rem; }
}
