/* =============================================================
   Marriage SaaS Platform — Design System
   "Rose & Ink": warm rose-gold gradient on a plum-ink base.
   Display: Fraunces · Body: Plus Jakarta Sans
   Developed by Ranker Solutions
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ---- Design tokens ---------------------------------------- */
:root {
    /* Brand */
    --rose:        #e6336a;
    --coral:       #ff7a59;
    --plum:        #3a1230;
    --ink:         #1c0f1a;
    --gold:        #f0b429;
    --verified:    #1d9bf0;   /* premium blue tick (per spec) */

    --grad-brand:  linear-gradient(120deg, var(--rose) 0%, var(--coral) 100%);

    /* Light surfaces */
    --bg:          #fff5f7;
    --bg-soft:     #fdeef2;
    --surface:     #ffffff;
    --text:        #2a1622;
    --text-muted:  #8a6b78;
    --border:      rgba(58, 18, 48, 0.10);

    /* Type */
    --font-display: 'Fraunces', Georgia, serif;
    --font-body:    'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

    /* Shape & motion */
    --radius:      18px;
    --radius-sm:   12px;
    --shadow:      0 18px 50px -20px rgba(58, 18, 48, 0.35);
    --ease:        cubic-bezier(0.22, 1, 0.36, 1);

    /* Bootstrap overrides */
    --bs-body-font-family: var(--font-body);
}

/* Dark theme */
[data-bs-theme="dark"] {
    --bg:          #150b13;
    --bg-soft:     #1f1020;
    --surface:     #251426;
    --text:        #f6e9ef;
    --text-muted:  #b891a4;
    --border:      rgba(255, 255, 255, 0.08);
    --shadow:      0 24px 60px -20px rgba(0, 0, 0, 0.6);
}

/* ---- Base -------------------------------------------------- */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    /* Native-app feel: no bounce highlight, safe-area aware */
    -webkit-tap-highlight-color: transparent;
    padding: env(safe-area-inset-top) env(safe-area-inset-right)
             env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.app-main { min-height: 100vh; }

.grad-text {
    background: var(--grad-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---- Buttons ---------------------------------------------- */
.btn-brand {
    background: var(--grad-brand);
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.7rem 1.5rem;
    box-shadow: 0 10px 24px -8px rgba(230, 51, 106, 0.6);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn-brand:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 16px 30px -8px rgba(230, 51, 106, 0.7);
}
.btn-brand:active { transform: translateY(0); }

.btn-outline-light {
    border-radius: 999px;
    padding: 0.7rem 1.5rem;
    font-weight: 600;
    border-color: var(--border);
    color: var(--text);
}
.btn-outline-light:hover { background: var(--bg-soft); color: var(--text); }

/* ---- Glassmorphism ---------------------------------------- */
.glass {
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ---- Hero -------------------------------------------------- */
.hero {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 3rem 0;
}
.hero__glow {
    position: absolute;
    inset: -30% -10% auto -10%;
    height: 70vh;
    background:
        radial-gradient(60% 60% at 30% 20%, rgba(230, 51, 106, 0.35), transparent 70%),
        radial-gradient(50% 50% at 80% 10%, rgba(255, 122, 89, 0.30), transparent 70%);
    filter: blur(10px);
    z-index: 0;
    animation: floatGlow 12s var(--ease) infinite alternate;
}
@keyframes floatGlow {
    from { transform: translateY(-10px) scale(1); }
    to   { transform: translateY(20px) scale(1.08); }
}
.hero__inner {
    position: relative;
    z-index: 1;
    max-width: 720px;
    text-align: center;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 60%, transparent);
    border: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(8px);
}
.brand-badge i { color: var(--rose); }

.hero__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.4rem, 7vw, 4.2rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 1rem;
}
.hero__subtitle {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: var(--text-muted);
    margin: 0 auto 2rem;
    max-width: 30ch;
}
.hero__cta {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}
.hero__note {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ---- Status card ------------------------------------------ */
.status-card {
    max-width: 380px;
    margin: 0 auto;
    padding: 1rem 1.25rem;
    text-align: left;
}
.status-card__row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}
.status-card__row:last-child { border-bottom: none; }
.status-card__row span { flex: 1; color: var(--text-muted); }
.status-card__row strong { font-weight: 600; }
.status-card__row i { font-size: 1.1rem; }

/* ---- Footer ----------------------------------------------- */
.site-footer {
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.site-footer .dot { margin: 0 0.5rem; opacity: 0.5; }

/* ---- Error page ------------------------------------------- */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
}
.error-code {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(5rem, 20vw, 10rem);
    line-height: 1;
}

/* ---- Theme toggle ----------------------------------------- */
.theme-toggle {
    position: fixed;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    backdrop-filter: blur(10px);
    color: var(--text);
    font-size: 1.2rem;
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 50;
    box-shadow: var(--shadow);
    transition: transform 0.25s var(--ease);
}
.theme-toggle:hover { transform: scale(1.08) rotate(-8deg); }

/* ---- Flash toasts ----------------------------------------- */
.flash-stack {
    position: fixed;
    top: calc(1rem + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: min(92vw, 420px);
}
.toast-flash {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideDown 0.4s var(--ease), fadeOut 0.4s var(--ease) 4s forwards;
}
.toast-flash i { font-size: 1.1rem; }
.toast-flash--success i { color: #16a34a; }
.toast-flash--danger  i { color: #dc2626; }
.toast-flash--info    i { color: var(--verified); }
.toast-flash--warning i { color: var(--gold); }

@keyframes slideDown { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeOut   { to { opacity: 0; transform: translateY(-10px); pointer-events: none; } }

/* ---- Focus visibility (a11y floor) ------------------------ */
:focus-visible {
    outline: 2px solid var(--rose);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---- Reduced motion --------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* =============================================================
   Stub pages (Module 2) — replaced by Modules 3 & 4
   ============================================================= */
.stub-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 2rem 0;
}
.stub-card {
    max-width: 460px;
    margin: 0 auto;
    padding: 1.75rem;
}
.stub-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stub-avatar {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--grad-brand);
    color: #fff;
    font-weight: 700;
    font-size: 1.4rem;
    font-family: var(--font-display);
    box-shadow: 0 10px 24px -10px rgba(230, 51, 106, 0.7);
}
.stub-avatar--admin { font-size: 1.5rem; }
.stub-name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}
.stub-meta {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.completion { margin-bottom: 1.25rem; }
.completion-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}
.completion-row span { color: var(--text-muted); }
.completion-bar {
    height: 7px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}
.completion-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--grad-brand);
    transition: width 0.6s var(--ease);
}
.completion small {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stub-rows { margin-bottom: 1.25rem; }
.stub-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}
.stub-row:last-child { border-bottom: none; }
.stub-row span { flex: 1; color: var(--text-muted); }
.stub-row i { font-size: 1.05rem; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.stat {
    text-align: center;
    padding: 0.9rem 0.5rem;
    border-radius: 14px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
}
.stat strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    line-height: 1;
    margin-bottom: 0.25rem;
}
.stat span { font-size: 0.72rem; color: var(--text-muted); }

.stub-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1rem;
}
.stub-actions { display: flex; flex-direction: column; gap: 0.5rem; }

.btn-ghost-danger {
    border-radius: 999px;
    padding: 0.7rem 1.5rem;
    font-weight: 600;
    border: 1px solid rgba(220, 38, 38, 0.3);
    background: transparent;
    color: #dc2626;
}
.btn-ghost-danger:hover { background: rgba(220, 38, 38, 0.08); color: #dc2626; }

.stub-modal {
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.stub-modal .form-control {
    border-radius: 12px;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid var(--border);
    background: var(--bg-soft);
    color: var(--text);
}
.stub-modal .form-control:focus {
    border-color: var(--rose);
    box-shadow: 0 0 0 4px rgba(230, 51, 106, 0.14);
    background: var(--bg-soft);
    color: var(--text);
}
