@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --bg-color: #ede4df;
    --primary-color: #964311;
    --primary-hover: #7a360d;
    --text-color: #282828;
    --text-light: #5a5a5a;
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.app-container {
    width: 100%;
    max-width: 800px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
    min-height: 600px;
    display: flex;
    flex-direction: column;
}

/* Header & Progress */
header {
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logo-img {
    max-width: 180px;
    height: auto;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
}

.progress-bar {
    height: 4px;
    background: #e0e0e0;
    width: 100%;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.5s ease;
}

/* Wizard Form Steps */
.wizard-content {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-color);
}

p.description {
    color: var(--text-light);
    margin-bottom: 30px;
}

/* Form Elements */
.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background: #fafafa;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(150, 67, 17, 0.1);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* Range Slider */
.range-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.range-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.2rem;
    min-width: 30px;
}

/* Buttons */
.nav-buttons {
    margin-top: auto;
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(150, 67, 17, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-light);
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background-color: #f5f5f5;
    color: var(--text-color);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Results Section */
.result-content {
    padding: 20px;
    background: #faf7f5;
    border-radius: var(--radius);
    border: 1px solid #e0d8d0;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(150, 67, 17, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Result Styling */
.goal-card {
    background: #fff;
    border: 1px solid #e0d8d0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.goal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: var(--primary-color);
    font-weight: 600;
}

.calendar-btn {
    display: inline-block;
    margin-top: 15px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9em;
    border: 1px solid var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    transition: var(--transition);
}

.calendar-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.timeline-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.quarter {
    background: #faf7f5;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.q-header {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-transform: uppercase;
    font-size: 0.9em;
}

.steps-container {
    background: #fdfdfd;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    border-left: 3px solid #ddd;
}

.steps-container h4 {
    font-size: 0.95em;
    margin-bottom: 10px;
    color: var(--text-color);
}

.next-steps-list {
    list-style: none;
    padding: 0;
}

.next-steps-list li {
    font-size: 0.9em;
    margin-bottom: 6px;
    color: #444;
}

.step-date {
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 5px;
}

.goal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.deadline-tag {
    font-size: 0.85em;
    font-weight: 600;
    color: #666;
}

/* ... existing sections ... */
.section-block {
    margin-top: 35px;
}

.simple-box {
    background: #fff;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 8px;
}

.highlight-box {
    background: rgba(150, 67, 17, 0.05);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.result-buttons-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.footer-note {
    text-align: center;
    margin-top: 40px;
    font-size: 0.8rem;
    color: #999;
}

/* Print Styling */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .app-container {
        box-shadow: none;
        max-width: 100%;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .nav-buttons,
    .progress-bar {
        display: none !important;
    }

    .no-print {
        display: none !important;
    }

    header {
        border-bottom: 2px solid var(--primary-color);
        margin-bottom: 20px;
    }

    .wizard-content {
        padding: 0;
    }

    .result-content {
        border: none;
        background: white;
    }

    h2 {
        font-size: 1.8rem;
    }

    h3 {
        font-size: 1.4rem;
        color: var(--primary-color);
        margin-top: 20px;
    }

    .goal-card {
        page-break-inside: avoid;
        border: 1px solid #ccc;
        box-shadow: none;
    }
}

/* Custom Checkbox Grid */
.areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.area-option {
    display: block;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.area-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.area-option span {
    display: block;
    padding: 15px;
    background: #fafafa;
    border: 2px solid #ddd;
    border-radius: 8px;
    color: var(--text-color);
    font-weight: 500;
    text-align: center;
    transition: var(--transition);
}

.area-option input:checked~span {
    background-color: rgba(150, 67, 17, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(150, 67, 17, 0.15);
}

.area-option:hover span {
    border-color: #ccc;
    transform: translateY(-2px);
}

.area-option input:checked:hover~span {
    border-color: var(--primary-color);
}

/* Month Calendar Grid */
.month-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.month-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
}

.month-name {
    font-weight: 700;
    color: var(--primary-color);
    border-bottom: 2px solid rgba(150, 67, 17, 0.1);
    padding-bottom: 5px;
    margin-bottom: 5px;
}

.month-focus {
    font-size: 0.85em;
    color: #444;
}

.closing-section {
    margin-top: 40px;
    text-align: center;
    padding: 30px;
    background: #fdfdfd;
    border-top: 1px dashed #ccc;
    font-style: italic;
    font-weight: 500;
    color: var(--primary-color);
}

/* Monthly Plan Grid for each Goal */
.monthly-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.monthly-plan-item {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
}

.mp-month {
    display: block;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 0.85em;
    text-transform: uppercase;
}

.mp-objective {
    display: block;
    font-size: 0.8em;
    color: #444;
    line-height: 1.4;
}

.mp-cal-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 1.2em;
    text-decoration: none;
    transition: transform 0.2s;
}

.mp-cal-link:hover {
    transform: scale(1.2);
}

/* Area and Sub-Goal Cards */
.area-section {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px dashed #e0d8d0;
}

.area-title {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.sub-goal-card {
    background: #fff;
    border: 1px solid #e0d8d0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.sub-goal-title {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.sub-goal-desc {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .app-container {
        min-height: auto;
    }

    header {
        padding: 20px;
    }

    .wizard-content,
    .result-content {
        padding: 20px;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    .timeline-grid {
        grid-template-columns: 1fr;
        /* Stack vertically */
    }

    .nav-buttons {
        flex-direction: column-reverse;
        /* Stack buttons, Back on bottom */
        gap: 15px;
    }

    .btn {
        width: 100%;
        /* Full width for touch */
    }

    .range-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .range-value {
        align-self: flex-end;
        margin-top: -30px;
        /* Pull up next to slider if stacked, or just let it flow */
        margin-top: 0;
    }

    .result-buttons-container {
        flex-direction: column;
    }

    .month-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        /* Smaller min-width */
    }
}