/* tracker.css - Exzema 7-Day Baseline Tracker Lead Magnet */

.tracker-page {
    background-color: var(--brand-cream);
    color: var(--brand-forest);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 5rem;
}

/* Header & Nav */
.tracker-header {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tracker-logo-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--brand-forest);
}

.tracker-logo-link img {
    height: 34px;
    width: auto;
}

.tracker-logo-link .logo-title {
    font-family: 'Lora', serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--brand-forest);
}

.tracker-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-resume {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 1.25rem;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(4px);
    border: 1.5px solid rgba(45, 58, 45, 0.22);
    border-radius: 100px;
    color: var(--brand-forest);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    box-sizing: border-box;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-resume:hover {
    border-color: var(--brand-forest);
    background: rgba(45, 58, 45, 0.08);
    transform: translateY(-1px);
}

/* Main Container */
.tracker-main {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 3.25rem 1.25rem 4rem;
    flex: 1;
}

@media (max-width: 768px) {
    .tracker-main {
        padding: 2.25rem 1rem 3.5rem;
    }
}

/* Hero Badge & Headings */
.tracker-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--brand-sand);
    color: var(--brand-clay);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.4rem 0.9rem;
    border-radius: 99px;
    margin-bottom: 1rem;
}

.tracker-badge .dot {
    width: 6px;
    height: 6px;
    background: var(--brand-clay);
    border-radius: 50%;
    animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.2); }
}

.tracker-title {
    font-family: 'Lora', serif;
    font-size: clamp(2rem, 5vw, 2.75rem);
    line-height: 1.15;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--brand-forest);
}

.tracker-title em {
    font-style: italic;
    color: var(--brand-clay);
}

.tracker-subtitle {
    font-size: 1.05rem;
    color: #556355;
    line-height: 1.55;
    margin-bottom: 2rem;
    max-width: 620px;
}

/* 7-Day Timeline Bar */
.timeline-card {
    background: #ffffff;
    border: 1px solid rgba(45, 58, 45, 0.08);
    border-radius: 18px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 4px 20px rgba(45, 58, 45, 0.03);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.timeline-phase-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--brand-forest);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.timeline-phase-status {
    font-size: 0.85rem;
    color: var(--brand-clay);
    font-weight: 600;
}

.timeline-steps {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    position: relative;
    min-height: 56px;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    cursor: default;
}

.step-node {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    border: 2px solid rgba(45, 58, 45, 0.15);
    background: var(--brand-cream);
    color: #8C998C;
    transition: all 0.3s ease;
}

.timeline-step.completed .step-node {
    background: var(--brand-success);
    border-color: var(--brand-success);
    color: #ffffff;
}

.timeline-step.active .step-node {
    background: var(--brand-clay);
    border-color: var(--brand-clay);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(193, 103, 87, 0.2);
    transform: scale(1.08);
}

.step-label {
    font-size: 0.72rem;
    color: #8C998C;
    font-weight: 500;
}

.timeline-step.active .step-label {
    color: var(--brand-clay);
    font-weight: 700;
}

.timeline-step.completed .step-label {
    color: var(--brand-success);
    font-weight: 600;
}

/* Logging Form Card */
.tracker-card {
    background: #ffffff;
    border: 1px solid rgba(45, 58, 45, 0.08);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 6px 30px rgba(45, 58, 45, 0.04);
    margin-bottom: 2rem;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

.section-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--brand-forest);
    margin-bottom: 0.75rem;
}

.section-hint {
    font-size: 0.8rem;
    color: #7A897A;
    font-weight: 400;
}

/* Trigger Chips */
.trigger-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.trigger-chip {
    background: var(--brand-cream);
    border: 1px solid rgba(45, 58, 45, 0.15);
    color: var(--brand-forest);
    padding: 0.5rem 0.9rem;
    border-radius: 99px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.trigger-chip:hover {
    border-color: var(--brand-clay);
    background: #ffffff;
}

.trigger-chip.selected {
    background: var(--brand-clay);
    border-color: var(--brand-clay);
    color: #ffffff;
}

.trigger-chip.selected::after {
    content: "✓";
    font-size: 0.8rem;
    font-weight: bold;
}

/* Custom Chip Styling & Remove Button */
.trigger-chip.custom-chip::after {
    display: none !important;
}

.trigger-chip .chip-label {
    display: inline;
}

.trigger-chip .chip-check {
    display: none;
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 0.15rem;
}

.trigger-chip.selected .chip-check {
    display: inline-block;
}

.trigger-chip .chip-remove {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.15rem;
    line-height: 1;
    padding: 0 0.15rem;
    margin-left: 0.25rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    border-radius: 50%;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.trigger-chip .chip-remove:hover {
    opacity: 1;
    transform: scale(1.2);
}

.trigger-chip:not(.selected) .chip-remove:hover {
    color: var(--brand-clay);
}

@keyframes chipPop {
    0% {
        transform: scale(0.85);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.trigger-chip.newly-added {
    animation: chipPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Custom Tag Input */
.custom-tag-bar {
    display: flex;
    gap: 0.5rem;
    position: relative;
    width: 100%;
}

.custom-tag-input {
    flex: 1;
    min-width: 0;
    padding: 0.75rem 1.15rem;
    border: 1px solid rgba(45, 58, 45, 0.2);
    border-radius: 99px;
    font-family: inherit;
    font-size: 0.92rem;
    background: var(--brand-cream);
    color: var(--brand-forest);
    outline: none;
    transition: border-color 0.2s;
}

.custom-tag-input:focus {
    border-color: var(--brand-clay);
    box-shadow: 0 0 0 3px rgba(193, 103, 87, 0.1);
}

.custom-tag-input:focus-visible {
    outline: 2.5px solid var(--brand-clay) !important;
    outline-offset: 2px !important;
}

.btn-add-tag {
    flex-shrink: 0;
    background: var(--brand-sand);
    border: none;
    color: var(--brand-forest);
    padding: 0 1.25rem;
    border-radius: 99px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add-tag:hover {
    background: #ebdccf;
}

/* Autocomplete Dropdown */
.autocomplete-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid rgba(45, 58, 45, 0.12);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(45, 58, 45, 0.08);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.autocomplete-item {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    color: var(--brand-forest);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    transition: background 0.15s;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: var(--brand-sand);
}

.autocomplete-item-category {
    font-size: 0.75rem;
    color: #8C998C;
}

/* Flare Severity Slider */
.flare-slider-container {
    background: var(--brand-cream);
    border: 1px solid rgba(45, 58, 45, 0.08);
    border-radius: 14px;
    padding: 1.25rem;
}

.flare-display-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.flare-value-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 99px;
    font-weight: 700;
    font-size: 0.9rem;
    background: #ffffff;
    border: 1px solid rgba(45, 58, 45, 0.1);
}

.flare-value-pill.calm { color: var(--brand-success); }
.flare-value-pill.mild { color: #8F7638; }
.flare-value-pill.moderate { color: #C47842; }
.flare-value-pill.severe { color: var(--brand-clay); }

.flare-range {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #4A7A59 0%, #D9A860 40%, #A84B3D 100%);
    outline: none;
}

.flare-range:focus-visible {
    outline: 2.5px solid var(--brand-clay) !important;
    outline-offset: 4px !important;
}

.flare-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid var(--brand-clay);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.1s;
}

.flare-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.flare-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 0.6rem;
    font-size: 0.75rem;
    color: #8C998C;
}

/* Routine Checkboxes */
.routine-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 540px) {
    .routine-grid {
        grid-template-columns: 1fr;
    }
}

.routine-checkbox-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(45, 58, 45, 0.12);
    border-radius: 12px;
    background: var(--brand-cream);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
}

.routine-checkbox-card:hover {
    border-color: var(--brand-clay);
}

.routine-checkbox-card.checked {
    background: #ffffff;
    border-color: var(--brand-forest);
    box-shadow: 0 2px 8px rgba(45, 58, 45, 0.05);
}

.routine-checkbox-card input[type="checkbox"] {
    display: none;
}

.routine-icon-box {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid rgba(45, 58, 45, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
    color: transparent;
    transition: all 0.2s;
}

.routine-checkbox-card.checked .routine-icon-box {
    background: var(--brand-forest);
    border-color: var(--brand-forest);
    color: #ffffff;
}

.routine-card-text {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--brand-forest);
}

/* Primary CTA Button */
.btn-save-log {
    width: 100%;
    padding: 1.15rem;
    background: var(--brand-clay);
    color: #ffffff;
    border: none;
    border-radius: 99px;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(193, 103, 87, 0.25);
    transition: all 0.25s ease;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-save-log:hover {
    background: #a95648;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(193, 103, 87, 0.35);
}

.btn-save-log:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Teaser / Locked Insights Card */
.insights-teaser-card {
    background: #ffffff;
    border: 1px solid rgba(45, 58, 45, 0.08);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(45, 58, 45, 0.03);
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.teaser-blur-content {
    filter: blur(4px);
    opacity: 0.45;
    pointer-events: none;
    user-select: none;
}

.dummy-graph-bar {
    height: 12px;
    background: linear-gradient(to right, var(--brand-clay) 60%, rgba(45, 58, 45, 0.1) 60%);
    border-radius: 6px;
    margin: 0.75rem 0;
}

.teaser-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    background: rgba(253, 251, 247, 0.7);
    backdrop-filter: blur(2px);
}

.teaser-icon {
    width: 44px;
    height: 44px;
    background: var(--brand-sand);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-forest);
    margin-bottom: 0.75rem;
}

.teaser-icon svg {
    display: block;
}

.teaser-title {
    font-family: 'Lora', serif;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--brand-forest);
    margin-bottom: 0.35rem;
}

.teaser-text {
    font-size: 0.88rem;
    color: #556355;
    max-width: 380px;
    line-height: 1.45;
}

/* Day 7 Handoff Completion Card */
.handoff-card {
    background: #ffffff;
    border: 2px solid var(--brand-clay);
    border-radius: 20px;
    padding: 2.25rem 2rem;
    box-shadow: 0 10px 40px rgba(193, 103, 87, 0.08);
    text-align: center;
    margin-bottom: 2rem;
}

.handoff-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(74, 122, 89, 0.1);
    color: var(--brand-success);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.4rem 1rem;
    border-radius: 99px;
    margin-bottom: 1.25rem;
}

.handoff-title {
    font-family: 'Lora', serif;
    font-size: 2rem;
    color: var(--brand-forest);
    margin-bottom: 0.75rem;
}

.handoff-desc {
    font-size: 1.05rem;
    color: #556355;
    margin-bottom: 1.75rem;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.summary-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    background: var(--brand-cream);
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.stat-box .stat-number {
    font-family: 'Lora', serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--brand-clay);
}

.stat-box .stat-label {
    font-size: 0.78rem;
    color: #7A897A;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.2rem;
}

.btn-app-store {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--brand-clay);
    color: #ffffff;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 99px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 18px rgba(193, 103, 87, 0.28);
    transition: all 0.2s ease;
}

.btn-app-store:hover {
    background: #a95647;
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(193, 103, 87, 0.4);
}

.handoff-microcopy {
    font-size: 0.85rem;
    color: #7A897A;
    margin-top: 1rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 58, 45, 0.45);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    z-index: 30000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 2.25rem 2rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 50px rgba(45, 58, 45, 0.15);
    position: relative;
    transform: translateY(15px);
    transition: transform 0.25s ease;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #8C998C;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s ease, color 0.2s ease;
}

.modal-close-btn:hover {
    background: rgba(45, 58, 45, 0.08);
    color: var(--brand-forest);
}

@media (max-width: 400px) {
    .modal-card {
        padding: 2rem 1.25rem;
    }
    .modal-overlay {
        padding: 0.75rem;
    }
}

.modal-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background: var(--brand-sand);
    color: var(--brand-clay);
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.modal-title {
    font-family: 'Lora', serif;
    font-size: 1.6rem;
    color: var(--brand-forest);
    line-height: 1.25;
    margin-bottom: 0.5rem;
}

.modal-desc {
    font-size: 0.92rem;
    color: #556355;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.modal-input {
    width: 100%;
    padding: 0.9rem 1.25rem;
    border: 1px solid rgba(45, 58, 45, 0.2);
    border-radius: 99px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    margin-bottom: 1rem;
    box-sizing: border-box;
}

.modal-input:focus {
    border-color: var(--brand-clay);
    box-shadow: 0 0 0 3px rgba(193, 103, 87, 0.1);
}

.modal-input:focus-visible {
    outline: 2.5px solid var(--brand-clay) !important;
    outline-offset: 2px !important;
}

.modal-btn {
    width: 100%;
    padding: 0.95rem;
    background: var(--brand-clay);
    color: #ffffff;
    border: none;
    border-radius: 99px;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(193, 103, 87, 0.25);
    transition: background 0.2s;
}

.modal-btn:focus-visible,
.modal-close-btn:focus-visible,
.btn-save-log:focus-visible,
.btn-text-logout:focus-visible {
    outline: 2.5px solid var(--brand-clay) !important;
    outline-offset: 3px !important;
}

.modal-btn:hover {
    background: #a95648;
}

.modal-privacy {
    font-size: 0.78rem;
    color: #8C998C;
    text-align: center;
    margin-top: 0.85rem;
}

@media (max-width: 360px) {
    .tracker-main {
        padding: 1.5rem 0.65rem 3rem;
    }
    .timeline-card {
        padding: 1rem 0.65rem;
    }
    .timeline-steps {
        gap: 0.25rem;
    }
    .step-node {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    .step-label {
        font-size: 0.65rem;
    }
}
