/* ================================================================
   PulseCheck — Web App Styles
   Zen · Botanical · Premium
   ================================================================ */

:root {
    --sage-400: #6aa584;
    --sage-500: #4d8a68;
    --sage-600: #3b7052;
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --dusk-400: #a78bfa;
    --text-primary: #1a2e22;
    --text-secondary: #4b6b58;
    --text-muted: #8aa898;
    --surface: rgba(255, 255, 255, 0.55);
    --border: rgba(143, 191, 160, 0.28);
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 8px 40px rgba(77, 138, 104, 0.12);
}

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

html,
body {
    width: 100%;
    height: 100%;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

body {
    background: linear-gradient(145deg, #d9f0df 0%, #ddeeff 50%, #e9d5ff 100%);
    transition: background 1.2s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Phase backgrounds ─────────────────────────────────────── */
body.phase-morning {
    background: linear-gradient(145deg, #d9efdf 0%, #f0fdf4 50%, #fef9e7 100%);
}

body.phase-focus {
    background: linear-gradient(145deg, #dbeafe 0%, #eff6ff 50%, #ecfdf5 100%);
}

body.phase-wind_down {
    background: linear-gradient(145deg, #ede9fe 0%, #fdf4ff 50%, #fce7f3 100%);
}

body.phase-night {
    background: linear-gradient(145deg, #0f0e17 0%, #1a1a2e 50%, #16213e 100%);
    --text-primary: #e0e7ff;
    --text-secondary: #a5b4fc;
    --text-muted: #6366f1;
    --surface: rgba(30, 27, 75, 0.5);
    --border: rgba(99, 102, 241, 0.22);
}

body.focus-mode {
    background: linear-gradient(145deg, #1e3a5f 0%, #1d2d50 50%, #1a1f3c 100%) !important;
    --text-primary: #e0e9ff;
    --text-secondary: #93c5fd;
    --text-muted: #5b7fa6;
    --surface: rgba(255, 255, 255, 0.07);
    --border: rgba(147, 197, 253, 0.18);
}

/* ── Animated background orbs ──────────────────────────────── */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.3;
    pointer-events: none;
    animation: drift 14s ease-in-out infinite alternate;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #a7f3d0, #6ee7b7);
    top: -140px;
    left: -140px;
    animation-duration: 16s;
}

.orb-2 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, #bfdbfe, #93c5fd);
    bottom: -100px;
    right: -100px;
    animation-duration: 11s;
}

.orb-3 {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, #ddd6fe, #c4b5fd);
    top: 40%;
    left: 55%;
    animation-duration: 19s;
}

@keyframes drift {
    from {
        transform: translate(0, 0) scale(1)
    }

    to {
        transform: translate(35px, 22px) scale(1.09)
    }
}

/* ── App wrapper ───────────────────────────────────────────── */
.app {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0 clamp(20px, 5vw, 64px);
}

/* ── Nav ───────────────────────────────────────────────────── */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 0 16px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sage-600);
}

.pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--sage-500);
    animation: pulseGlow 2.2s ease-in-out infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(77, 138, 104, 0.5);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(77, 138, 104, 0);
    }
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.clock {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 0.05em;
    font-variant-numeric: tabular-nums;
}

.phase-btn {
    font-size: 11px;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    backdrop-filter: blur(12px);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.25s ease;
}

.phase-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--blue-400);
    color: var(--blue-500);
    transform: translateY(-1px);
}

.phase-btn.focus-active {
    background: #2563eb;
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.28);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.28);
    }

    50% {
        box-shadow: 0 0 0 7px rgba(59, 130, 246, 0.08);
    }
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--sage-400);
    transform: scale(1.08);
}

/* ── Focus toast ───────────────────────────────────────────── */
.focus-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #1d4ed8, #4338ca);
    border-radius: var(--radius-sm);
    padding: 13px 18px;
    box-shadow: 0 6px 28px rgba(29, 78, 216, 0.38);
    margin-bottom: 8px;
    animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.focus-toast-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.focus-toast-text {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
}

.focus-toast-timer {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    text-shadow: 0 0 14px rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.focus-end-btn {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.focus-end-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* ── Main ──────────────────────────────────────────────────── */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
    width: 100%;
    padding: 32px 0 48px;
}

/* Greeting pill */
.greeting-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 22px;
    backdrop-filter: blur(12px);
    animation: fadeUp 0.6s ease;
}

.greeting-sub {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.greeting-sep {
    width: 1px;
    height: 16px;
    background: var(--border);
    flex-shrink: 0;
}

.greeting-name {
    font-family: 'Playfair Display', serif;
    font-size: 19px;
    font-style: italic;
    color: var(--sage-500);
}

/* Phase badge */
.phase-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 6px 18px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    backdrop-filter: blur(12px);
    animation: fadeUp 0.7s ease;
}

/* Quote */
.quote-wrap {
    width: 100%;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeUp 0.8s ease;
}

.quote-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(143, 191, 160, 0.3);
    border-top-color: var(--sage-500);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

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

.quote-block {
    animation: fadeUp 0.5s ease;
    max-width: 640px;
}

.quote-text {
    font-family: 'Playfair Display', serif;
    font-size: clamp(19px, 2.4vw, 28px);
    font-style: italic;
    color: var(--text-primary);
    line-height: 1.7;
    margin-bottom: 14px;
}

.quote-author {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

/* Action buttons */
.actions-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 999px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.24s ease;
    backdrop-filter: blur(8px);
}

.break-btn {
    border: 1.5px solid var(--border);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(195, 223, 201, 0.3));
    color: var(--sage-600);
}

.break-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--sage-400);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(77, 138, 104, 0.15);
}

.refresh-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 13px;
}

.refresh-btn:hover {
    color: var(--sage-600);
    border-color: var(--sage-400);
    transform: translateY(-1px);
}

/* Break panel */
.break-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.75), rgba(219, 234, 254, 0.4));
    border: 1px solid rgba(147, 197, 253, 0.4);
    border-radius: var(--radius);
    padding: 24px 28px;
    backdrop-filter: blur(14px);
    max-width: 560px;
    width: 100%;
    box-shadow: 0 6px 28px rgba(59, 130, 246, 0.1);
    animation: fadeUp 0.3s ease;
}

.break-content {
    font-size: 14px;
    line-height: 1.85;
    color: var(--text-secondary);
    text-align: left;
    margin-bottom: 18px;
}

.break-content h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.break-content p {
    margin-bottom: 7px;
}

.break-content strong {
    color: var(--blue-500);
}

.break-close-btn {
    padding: 11px 28px;
    border: none;
    border-radius: 999px;
    background: var(--sage-500);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.break-close-btn:hover {
    background: var(--sage-600);
}

/* Intention card */
.intention-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 26px;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 560px;
    animation: fadeUp 0.9s ease;
}

.intention-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.intention-icon {
    font-size: 13px;
    color: var(--sage-400);
}

.intention-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    flex: 1;
    text-align: left;
}

.intention-save-btn {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sage-600);
    background: rgba(77, 138, 104, 0.1);
    border: 1px solid rgba(77, 138, 104, 0.22);
    border-radius: 8px;
    padding: 4px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.intention-save-btn:hover {
    background: rgba(77, 138, 104, 0.2);
    border-color: var(--sage-400);
}

.intention-save-btn.saved {
    color: #fff;
    background: var(--sage-500);
    border-color: var(--sage-500);
}

.intention-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.intention-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.intention-input {
    border: none;
    border-bottom: 1.5px solid var(--border);
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    padding: 6px 2px;
    transition: border-color 0.2s;
    width: 100%;
}

.intention-input:focus {
    border-bottom-color: var(--sage-400);
}

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

.intention-divider {
    height: 1px;
    background: var(--border);
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0 24px;
    font-size: 12px;
    color: var(--text-muted);
}

.footer-link {
    color: var(--sage-500);
    text-decoration: none;
    font-weight: 500;
}

.footer-link:hover {
    text-decoration: underline;
}

/* ── Settings overlay ──────────────────────────────────────── */
.settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: overlayIn 0.25s ease;
}

@keyframes overlayIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

.settings-panel {
    background: rgba(248, 253, 248, 0.97);
    border-radius: var(--radius);
    padding: 28px 32px;
    width: 360px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: panelIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: scale(0.93)
    }

    to {
        opacity: 1;
        transform: scale(1)
    }
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.settings-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.settings-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
}

.settings-close-btn:hover {
    color: var(--text-primary);
}

.settings-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 8px;
    font-weight: 500;
}

.settings-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    background: #fff;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.settings-input:focus {
    border-color: var(--sage-400);
}

.settings-save-btn {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: none;
    background: linear-gradient(135deg, var(--sage-500), var(--sage-400));
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.settings-save-btn:hover {
    opacity: 0.88;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
    .nav {
        padding: 16px 0 12px;
    }

    .clock {
        display: none;
    }

    .main {
        gap: 22px;
        padding: 24px 0 36px;
    }

    .quote-text {
        font-size: 18px;
    }

    .greeting-pill {
        padding: 8px 16px;
    }
}