/**
 * Lucidaily - Styles
 * "Un peu plus clair, chaque jour"
 */

:root {
    --bg: #FDFCFA;
    --bg-card: #FFFFFF;
    --text: #2E2C2A;
    --text-muted: #787470;
    --text-light: #A8A49C;
    --accent: #5B7B6A;
    --accent-hover: #4A6A59;
    --accent-soft: #F4F7F5;
    --border: #ECEAE5;
    --success: #5B7B6A;
    --error: #C23A2B;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Newsreader', Georgia, serif;
    --radius: 12px;
    --radius-full: 100px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
}

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
}

.container { max-width: 640px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header {
    position: sticky; top: 0;
    background: rgba(253, 252, 250, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.header-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }

.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem; font-weight: 500;
    color: var(--text); text-decoration: none;
}
.logo span { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 24px; }
.nav-link { font-size: 0.9375rem; color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.nav-link:hover, .nav-link.active { color: var(--text); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 24px; border-radius: var(--radius-full);
    font-family: var(--font-sans); font-size: 0.9375rem; font-weight: 500;
    text-decoration: none; cursor: pointer; border: none; transition: all 0.2s;
}
.btn-primary { background: var(--text); color: #fff; }
.btn-primary:hover { background: #333; }
.btn-secondary { background: var(--accent); color: #fff; }
.btn-secondary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--text); color: var(--text); }
.btn-sm { padding: 8px 16px; font-size: 0.875rem; }

/* Cards */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 8px; }
.form-input {
    width: 100%; padding: 14px 16px;
    border: 1.5px solid var(--border); border-radius: var(--radius);
    font-family: var(--font-sans); font-size: 1rem; transition: border-color 0.2s;
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-input::placeholder { color: var(--text-light); }
textarea.form-input { resize: vertical; min-height: 100px; }

/* Flash */
.flash { padding: 14px 18px; border-radius: var(--radius); font-size: 0.9375rem; }
.flash-success { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); }
.flash-error { background: #FEF2F2; color: var(--error); border: 1px solid var(--error); }

/* Subjects */
.subjects-grid { display: flex; flex-direction: column; gap: 16px; }
.subject-choice { cursor: pointer; transition: all 0.2s; }
.subject-choice:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.subject-theme {
    display: inline-block; font-size: 0.75rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); margin-bottom: 8px;
}
.subject-title { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 500; line-height: 1.3; margin-bottom: 8px; }
.subject-accroche { font-size: 0.9375rem; color: var(--text-muted); line-height: 1.6; }

/* Reading */
.reading { padding: 48px 0 80px; }
.reading-header { margin-bottom: 40px; text-align: center; }
.reading-theme { font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); margin-bottom: 16px; }
.reading-title { font-family: var(--font-serif); font-size: 2rem; font-weight: 500; line-height: 1.2; margin-bottom: 16px; }
.reading-accroche { font-size: 1.125rem; color: var(--text-muted); max-width: 500px; margin: 0 auto; }
.reading-content { font-family: var(--font-serif); font-size: 1.0625rem; line-height: 1.75; }
.reading-section { margin-bottom: 32px; }
.reading-section p { margin-bottom: 20px; }
.reading-section-title { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 500; margin-bottom: 16px; }

/* Integration */
.integration { background: var(--accent-soft); border-radius: var(--radius); padding: 32px; margin: 48px 0; }
.integration-title { font-family: var(--font-serif); font-size: 1.125rem; font-weight: 500; margin-bottom: 20px; color: var(--accent); }
.integration-question {
    font-family: var(--font-serif); font-size: 1rem; font-style: italic;
    margin-bottom: 16px; padding-left: 16px; border-left: 2px solid var(--accent);
}
.integration-question:last-child { margin-bottom: 0; }

/* Humanisation */
.humanisation { text-align: center; padding: 32px 0; margin: 32px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.humanisation-text { font-family: var(--font-serif); font-size: 1.125rem; font-style: italic; color: var(--text-muted); max-width: 480px; margin: 0 auto; }

/* Actions */
.actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Invitation */
.invitation-card { background: var(--accent-soft); border-color: var(--accent); }
.invitation-from { font-size: 0.875rem; color: var(--accent); margin-bottom: 12px; }
.invitation-message { font-style: italic; color: var(--text-muted); margin-top: 12px; padding: 12px; background: rgba(255,255,255,0.5); border-radius: 8px; }

/* Stats */
.stat-subtle { text-align: center; color: var(--text-light); font-size: 0.875rem; }
.stat-number { font-family: var(--font-serif); font-size: 1.5rem; color: var(--accent); display: block; margin-bottom: 4px; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-family: var(--font-serif); font-size: 1.25rem; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); }

/* Modal */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 1000;
    align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal { background: var(--bg-card); border-radius: var(--radius); padding: 32px; max-width: 400px; width: 100%; }
.modal-title { font-family: var(--font-serif); font-size: 1.25rem; margin-bottom: 24px; }

/* History */
.history-item { padding: 20px 0; border-bottom: 1px solid var(--border); }
.history-item:last-child { border-bottom: none; }
.history-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.history-date { font-size: 0.8125rem; color: var(--text-light); }
.history-saved { font-size: 0.75rem; color: var(--accent); background: var(--accent-soft); padding: 4px 8px; border-radius: 4px; }
.history-title { font-family: var(--font-serif); font-size: 1.0625rem; text-decoration: none; display: block; margin-bottom: 4px; }
.history-title:hover { color: var(--accent); }
.history-note { font-size: 0.875rem; font-style: italic; color: var(--text-muted); margin-top: 8px; padding: 8px 12px; background: var(--accent-soft); border-radius: 6px; }

/* Premium */
.premium-banner { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%); color: #fff; border-radius: var(--radius); padding: 32px; text-align: center; }
.premium-banner h2 { font-family: var(--font-serif); font-size: 1.5rem; margin-bottom: 12px; }
.premium-banner p { opacity: 0.9; margin-bottom: 24px; }
.premium-price { font-size: 2rem; font-weight: 600; }
.premium-price span { font-size: 1rem; font-weight: 400; opacity: 0.8; }

/* Footer */
.footer { margin-top: auto; padding: 32px 0; border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-brand { font-family: var(--font-serif); font-size: 1.25rem; color: var(--text); text-decoration: none; }
.footer-brand span { color: var(--accent); }
.footer-tag { color: var(--text-muted); font-size: 0.875rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.875rem; }
.footer-links a:hover { color: var(--text); }

/* Auth */
.auth-page { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { max-width: 400px; width: 100%; }
.auth-title { font-family: var(--font-serif); font-size: 1.75rem; text-align: center; margin-bottom: 8px; }
.auth-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 32px; }
.auth-footer { text-align: center; margin-top: 24px; font-size: 0.9375rem; color: var(--text-muted); }
.auth-footer a { color: var(--accent); text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* Utilities */
.text-muted { color: var(--text-muted); }
.text-small { font-size: 0.875rem; }
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* Responsive */
@media (max-width: 640px) {
    .header-inner { height: 56px; }
    .nav { gap: 16px; }
    .reading-title { font-size: 1.5rem; }
    .actions { flex-direction: column; }
    .btn { width: 100%; }
    .footer-inner { flex-direction: column; text-align: center; }
}
