/* ----------------------------------------------------
 * NEWCO STYLE GUIDE V1.3 - CORE STYLES & VARIABLES
 * ---------------------------------------------------- */

/* --- CSS Variables & Global Resets --- */
:root {
    /* Colors (Sprout Green Theme) */
    --color-primary: #58B88E; /* Sprout Green (Brand accent / CTAs) */
    --color-primary-hover: #4AA67E; /* Sprout Green Darken 10% */
    --color-text: #334155; /* Slate Gray (Primary text / headlines) */
    --color-bg: #FAFAF7; /* Cream White (Page & card backgrounds) */
    --color-accent: #F79A86; /* Warm Coral (Alerts / errors) */
    --color-placeholder: #94A3B8; /* Light Gray */
    --color-completed-bg: #F0FFF7; /* Muted background for completed tasks */
    --color-secondary-hover-bg: #E6F4EE; /* Tinted background for secondary/hover */
    --color-border-light: #8DCEB2; /* Light border color */
    
    /* Link Colors */
    --color-link-unvisited: #409C6D; /* Darker green for unvisited */
    --color-link-visited: #7ED2AC; /* Lighter, more subdued green for visited link */
    
    /* Typography - Updated to DM Sans for friendly look */
    --font-headline: 'Cormorant Garamond', serif;
    /* --font-body: 'Inter', sans-serif; */
    --font-body: 'Poppins', sans-serif;

    /* Layout & Spacing */
    --max-width: 1200px;
    --radius-default: 10px;
    --radius-input: 8px;
    --shadow-card: 0 4px 8px rgba(0,0,0,0.06);
    --transition-default: all 0.2s ease;
    --padding-desktop: 48px;
    --padding-mobile: 24px;
    --spacing-1: 8px;
    --spacing-2: 16px;
    --spacing-3: 24px;
    --spacing-4: 32px;
    --spacing-5: 48px;

    /* Font weights */
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;

    /* Line heights */
    --lh-tight: 1.2;
    --lh-normal: 1.4;
    --lh-relaxed: 1.6;
    --lh-loose: 1.75;

    /* Fluid type scale using clamp(min, preferred, max) */
    --fs-h1: clamp(2.25rem, 4vw + 1rem, 3.5rem);   /* ~36–56px */
    --fs-h2: clamp(1.75rem, 3vw + 0.5rem, 2.25rem);/* ~28–36px */
    --fs-h3: clamp(1.375rem, 2vw + 0.5rem, 1.75rem);/* ~22–28px */
    --fs-h4: clamp(1.125rem, 1.2vw + 0.5rem, 1.375rem);/* ~18–22px */
    --fs-h5: clamp(1rem, 1vw + 0.4rem, 1.125rem); /* ~16–18px */
    --fs-h6: clamp(0.875rem, 0.8vw + 0.4rem, 1rem);/* ~14–16px */

    --fs-body: 1rem; /* 16px base */
    --fs-small: 0.875rem; /* 14px */
    --fs-caption: 0.75rem; /* 12px */
}

/* --- Global Resets & Typography --- */
body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg);
    margin: 0;
    line-height: 1.6;
    padding: var(--padding-mobile);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing-5) 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headline);
  font-weight: var(--weight-semibold);
  color: #2C2C2C;
  margin: 0 0 0.6em;
}

h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
}

h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-tight);
}

h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-normal);
}

h4 {
  font-size: var(--fs-h4);
  line-height: var(--lh-normal);
}

h5 {
  font-size: var(--fs-h5);
  line-height: var(--lh-normal);
}

h6 {
  font-size: var(--fs-h6);
  line-height: var(--lh-normal);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

p {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.8;
}

/* --- Semantic Text Elements --- */

/* Bold and Strong */
strong, b {
    font-weight: 700;
    color: var(--color-text);
}

/* Emphasis and Citation */
em, cite {
    font-style: italic;
    color: var(--color-primary-hover);
}

/* Abbreviations and Address */
abbr, address {
    font-style: normal;
    text-decoration: underline dotted var(--color-placeholder);
    cursor: help;
}
address {
    line-height: 1.8;
    margin-bottom: var(--spacing-4);
    font-size: 14px;
}

/* Blockquotes and Quotes */
blockquote {
    border-left: 4px solid var(--color-primary);
    padding: var(--spacing-2) var(--spacing-3);
    margin: var(--spacing-3) 0;
    background-color: var(--color-secondary-hover-bg);
    font-style: italic;
}
q {
    font-style: italic;
    quotes: "“" "”" "‘" "’";
}

a:link {
    color: var(--color-link-unvisited);
    text-decoration: none;
    transition: var(--transition-default);
    padding: 2px 4px;
    border-radius: 4px;
}
a:visited {
    color: var(--color-link-visited);
    text-decoration: none;
}
a:hover {
    color: var(--color-primary-hover);
    background-color: var(--color-secondary-hover-bg);
    text-decoration: underline;
    text-underline-offset: 2px;
}
a:active {
    background-color: #D4EAE0;
}

/* Demo-only overrides so visited/unvisited show regardless of real history */
  .demo-unvisited {
    color: var(--color-link-unvisited) !important;
  }
  .demo-visited {
    color: var(--color-link-visited) !important;
  }

/* Figures and Captions */
figure {
    margin: var(--spacing-4) 0;
    padding: 0;
    display: block;
    max-width: 100%;
}
figcaption {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-placeholder);
    margin-top: var(--spacing-1);
    font-style: italic;
}

/* Lists */
ul, ol {
    padding-left: var(--spacing-4);
    margin-bottom: var(--spacing-3);
}
ul li, ol li {
    margin-bottom: var(--spacing-1);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-4);
    box-shadow: var(--shadow-card);
    background-color: white;
}
th, td {
    padding: 12px 16px;
    border: 1px solid var(--color-border-light);
    text-align: left;
}
th {
    background-color: var(--color-secondary-hover-bg);
    font-family: var(--font-headline);
    font-weight: 600;
    color: var(--color-text);
    border-color: #DDE2E8;
}

/* --- Layout Components --- */
.card {
    background-color: white;
    border-radius: 12px;
    padding: var(--spacing-4);
    box-shadow: var(--shadow-card);
    margin-bottom: var(--spacing-5);
    transition: var(--transition-default);
}

.card:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* Card Header */
.card-header {
    padding-bottom: var(--spacing-3);
    border-bottom: 2px solid #E2E8F0;
    margin-bottom: var(--spacing-3);
}

.card-header h3,
.card-header h4 {
    margin-bottom: 0;
    color: var(--color-text);
}

/* Card Body */
.card-body {
    padding: var(--spacing-2) 0;
}

/* Card Footer */
.card-footer {
    padding-top: var(--spacing-3);
    border-top: 1px solid #E2E8F0;
    margin-top: var(--spacing-3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-2);
}

/* Card Variants */
.card-bordered {
    border: 2px solid #E2E8F0;
    box-shadow: none;
}

.card-bordered:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-card);
}

.card-accent {
    border-left: 5px solid var(--color-primary);
}

.card-highlighted {
    background: linear-gradient(135deg, rgba(88, 184, 142, 0.05) 0%, rgba(247, 154, 134, 0.05) 100%);
    border: 1px solid var(--color-border-light);
}

.split {
    display: flex;
    gap: var(--spacing-4);
}
.split > div {
    flex: 1;
}
@media (max-width: 768px) {
    .split {
        flex-direction: column;
    }
}

.btn {
    font-family: var(--font-headline);
    font-weight: 600;
    font-size: 16px;
    padding: 14px 28px;
    border-radius: var(--radius-default);
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition-default);
    
    /* Vertical Centering */
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    
    text-decoration: none;
    text-align: center;
    min-height: 44px;
    min-width: 44px;
}

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

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-secondary:hover {
    background-color: var(--color-secondary-hover-bg);
    transform: translateY(-2px);
}

.btn-disabled {
    background-color: lightgray;
    color: #7A7A7A;
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}
.btn-disabled:hover {
    color: white;
}

/* --- Form Styles: Inputs, Select, Textarea (Remaining styles kept for consistency) --- */
.form-group {
    margin-bottom: var(--spacing-4);
}

label {
    display: block;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 14px;
    color: var(--color-text);
    margin-bottom: var(--spacing-1);
}

input[type="text"], input[type="email"], input[type="password"], textarea, select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-input);
    background-color: white;
    box-sizing: border-box;
    transition: var(--transition-default);
    font-size: 16px;
    font-family: var(--font-body);
}
textarea {
    resize: vertical;
    min-height: 120px;
}
select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Cpath%20fill%3D%22%23334155%22%20d%3D%22M10%204H2L6%208z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}
/* FIX: Multi-select dropdown styling */
select[multiple] {
    /* REMOVING height: auto and min-height: 150px to prevent it from becoming a full list box */
    /* Instead, we set a reasonable height and let the native scrolling handle the overflow */
    min-height: 120px; /* Use a fixed, but reasonable minimum height */
    height: 120px;
    
    padding-right: 16px;
    background-image: none; 
}

input::placeholder, textarea::placeholder {
    color: var(--color-placeholder);
}

input:focus, textarea:focus, select:focus {
    border: 1px solid var(--color-primary);
    box-shadow: 0 0 0 3px rgba(88, 184, 142, 0.2);
    outline: none;
}

/* Error States */
.input-error {
    border-color: var(--color-accent) !important;
}
.input-error:focus {
     box-shadow: 0 0 0 3px rgba(247, 154, 134, 0.2);
}
.error-text {
    color: var(--color-accent);
    font-size: 14px;
    margin-top: var(--spacing-1);
    display: block;
}

/* Custom Checkbox/Radio Styling */
.radio-group, .checkbox-group {
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    margin-bottom: var(--spacing-2);
    user-select: none;
    min-height: 20px;
    align-items: center;
}
.radio-group input, .checkbox-group input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}
.custom-control {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border: 1px solid #E2E8F0;
    background-color: #fff;
    transition: var(--transition-default);
}
.radio-group .custom-control {
    border-radius: 50%;
}
.checkbox-group .custom-control {
    border-radius: 4px;
}
.radio-group:hover .custom-control, .checkbox-group:hover .custom-control {
    border-color: var(--color-primary);
    background-color: var(--color-secondary-hover-bg);
}

/* Selected State */
.radio-group input:checked ~ .custom-control {
    border-color: var(--color-primary);
}
.radio-group input:checked ~ .custom-control::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-primary);
    transform: translate(-50%, -50%);
}
.checkbox-group input:checked ~ .custom-control {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}
.checkbox-group input:checked ~ .custom-control::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 3px;
    color: white;
    font-size: 16px;
    line-height: 20px;
}

/* --- Progress Indicator (Rest of interactive styles kept for consistency) --- */
.progress-indicator {
    height: 6px;
    background-color: #E2E8F0;
    border-radius: 3px;
    margin-bottom: var(--spacing-4);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background-color: var(--color-primary);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* --- Accordion --- */
.accordion-item {
    margin-bottom: var(--spacing-2);
}
.accordion-header {
    background-color: white;
    padding: 16px;
    border-radius: var(--radius-input);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    transition: var(--transition-default);
    box-shadow: var(--shadow-card);
}
.accordion-header:hover {
    background-color: var(--color-secondary-hover-bg);
}
.accordion-item.is-expanded .accordion-header {
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.accordion-icon {
    transform: rotate(0deg);
    transition: transform 0.2s ease;
}
.accordion-item.is-expanded .accordion-icon {
    transform: rotate(180deg);
}
.accordion-content {
    background-color: white;
    padding: 0 16px;
    border-bottom-left-radius: var(--radius-input);
    border-bottom-right-radius: var(--radius-input);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}
.accordion-item.is-expanded .accordion-content {
    max-height: 500px;
    padding: 16px;
}

/* --- Tabbed Menu --- */
.tabs-container {
    background-color: white;
    border-radius: var(--radius-default);
    box-shadow: var(--shadow-card);
    padding: var(--spacing-3);
}
.tab-headers {
    display: flex;
    border-bottom: 2px solid #E2E8F0;
    margin-bottom: var(--spacing-3);
    flex-wrap: wrap;
}
.tab-header {
    padding: 12px 24px;
    cursor: pointer;
    font-family: var(--font-headline);
    font-weight: 600;
    color: var(--color-placeholder);
    transition: var(--transition-default);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
}
.tab-header:hover {
    color: var(--color-primary-hover);
}
.tab-header.is-active {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
}
.tab-content {
    display: none;
    padding: var(--spacing-2) 0;
}
.tab-content.is-active {
    display: block;
}

/* Mobile: Tabs stack vertically (pancake stack) */
@media (max-width: 768px) {
    .tab-headers {
        flex-direction: column;
        border-bottom: none;
        gap: var(--spacing-1);
    }
    .tab-header {
        padding: 12px 16px;
        border-bottom: none;
        border-left: 3px solid transparent;
        margin-bottom: 0;
        margin-left: -2px;
        border-radius: var(--radius-input);
        background-color: var(--color-bg);
    }
    .tab-header.is-active {
        border-left: 3px solid var(--color-primary);
        border-bottom: none;
        background-color: var(--color-secondary-hover-bg);
    }
    .tab-header:hover {
        background-color: var(--color-secondary-hover-bg);
    }
}

/* --- Carousel --- */
.carousel-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-default);
}
.carousel-inner {
    display: flex;
    transition: transform 0.4s ease-in-out;
}
.carousel-item {
    min-width: 100%;
    box-sizing: border-box;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    font-family: var(--font-headline);
    font-weight: 700;
}
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(51, 65, 85, 0.6);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
    font-size: 24px;
    line-height: 1;
    transition: background 0.2s;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
}
.carousel-control:hover {
    background: var(--color-primary);
}

.prev-control {
    left: 10px;
}
.next-control {
    right: 10px;
}

/* --- Checklist Item --- */
.checklist-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-2);
    border-radius: var(--radius-input);
    background-color: white;
    transition: var(--transition-default);
    margin-bottom: var(--spacing-2);
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.checklist-item:hover {
    background-color: var(--color-secondary-hover-bg);
}
.checklist-item.is-completed {
    background-color: var(--color-completed-bg);
}
.checklist-item.is-completed .item-label {
    color: #777;
    text-decoration: line-through;
}
.checklist-item .item-label {
    flex-grow: 1;
    margin-left: var(--spacing-2);
}

