/* Base & Variables */
:root {
    --primary-color: #0d233a;
    /* Deep Navy Blue */
    --primary-light: #163657;
    /* Lighter Navy */
    --accent-color: #d13223;
    /* Urgent Red/Orange */
    --accent-hover: #b0271b;
    --text-main: #1e293b;
    /* Slate Gray */
    --text-muted: #475569;
    --bg-main: #ffffff;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;

    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-stack);
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.2;
    color: var(--primary-color);
    font-weight: 700;
}

p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Utilities */
.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #ffffff;
    box-shadow: 0 4px 14px 0 rgba(209, 50, 35, 0.39);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(209, 50, 35, 0.23);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-light);
}

/* Navigation */
.navbar {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    padding: 0.6rem 0;
    transition: all 0.3s ease;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.nav-btn {
    background-color: var(--accent-color);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.nav-btn:hover {
    background-color: var(--accent-hover);
}

/* Hero Section */
.hero {
    padding: 85px 0 35px;
    background: linear-gradient(to bottom, #f0f4f8, #ffffff);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(13, 35, 58, 0.03) 0%, transparent 50%);
    z-index: 0;
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
    max-width: 900px;
}

.hero-title {
    font-size: clamp(2rem, 4.5vw, 3.8rem);
    letter-spacing: -1.5px;
    margin-bottom: 1rem;
}

.hero-title .highlight {
    color: var(--accent-color);
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-muted);
    max-width: 760px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
    font-weight: 400;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Sections */
section {
    padding: 55px 0;
}

.section-title {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
    letter-spacing: -1px;
}

.section-title.text-left {
    text-align: left;
    margin-bottom: 1rem;
}

.section-intro {
    font-size: 1.25rem;
    margin-bottom: 3rem;
    max-width: 800px;
}

/* The Context Section */
.context-section {
    background-color: var(--bg-main);
}

.grid {
    display: grid;
    gap: 2rem;
}

.context-grid {
    grid-template-columns: repeat(3, 1fr);
}

.context-grid .rule-card {
    grid-column: 1 / -1;
}

.card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.rule-card {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.rule-card h3 {
    color: white;
}

.rule-card p {
    color: #cbd5e1;
}

.link-btn {
    display: inline-block;
    margin-top: 1.5rem;
    color: white;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 2px;
    transition: color 0.2s, border-color 0.2s;
}

.link-btn:hover {
    color: var(--accent-color);
    border-color: white;
}

/* The Problem Section */
.problem-section {
    background-color: var(--bg-light);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.problem-content {
    max-width: 900px;
    margin: 0 auto;
}

.problem-blocks {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.problem-item {
    display: flex;
    background: var(--bg-main);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    gap: 2rem;
    align-items: flex-start;
}

.problem-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--border-color);
    line-height: 1;
}

.problem-text h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.problem-text p {
    margin-bottom: 0;
    font-size: 1.1rem;
}

/* Action Center & Personalization */
.action-section {
    background-color: var(--bg-main);
}

.section-subtitle {
    text-align: center;
    max-width: 600px;
    margin: -1rem auto 3rem;
    font-size: 1.125rem;
}

.personalization-panel {
    max-width: 900px;
    margin: 0 auto 2.5rem;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-sm);
}

.personalization-panel h4 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.personalization-panel p {
    margin-bottom: 1.25rem;
}

.privacy-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background-color: #eff6ff;
    /* Soft trust blue */
    border: 1px solid #bfdbfe;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    color: #1e3a8a;
}

.privacy-notice .icon {
    font-size: 1.25rem;
    line-height: 1;
}

.privacy-notice p {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: inherit;
    line-height: 1.5;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.95rem;
    color: var(--text-main);
}

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 35, 58, 0.1);
}

.resource-links {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.accordion-container {
    max-width: 900px;
    margin: 0 auto;
}

.accordion {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    background-color: var(--bg-main);
    box-shadow: var(--shadow-sm);
}

.accordion-header {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.2s;
}

.accordion-header:hover {
    background-color: var(--bg-light);
}

.accordion-header h4 {
    font-size: 1.25rem;
    margin: 0;
    color: var(--primary-color);
}

.accordion-header .icon {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.accordion.active .icon {
    transform: rotate(45deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion.active .accordion-content {
    /* Set explicitly via JS to allow smooth animation */
    box-sizing: border-box;
}

.accordion-inner-content {
    padding: 0 2rem 2rem;
}

.template-instructions {
    margin-top: 1rem;
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.template-box {
    position: relative;
    background-color: #f1f5f9;
    border-radius: 8px;
    padding: 2rem;
    border: 1px solid var(--border-color);
}

.copy-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.copy-btn:hover {
    background-color: var(--bg-light);
    border-color: #cbd5e1;
}

.copy-btn.success {
    background-color: #10b981;
    color: white;
    border-color: #10b981;
}

.template-text {
    font-family: var(--font-stack);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-main);
    white-space: pre-wrap;
    margin: 0;
    padding-top: 2rem;
    /* Make room for the button */
}

.placeholder {
    background-color: #fef08a;
    /* Soft yellow highlight */
    color: #854d0e;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: 600;
}

/* Footer */
.site-footer {
    background-color: var(--primary-color);
    color: #cbd5e1;
    text-align: center;
    padding: 3rem 0;
}

.site-footer p {
    color: inherit;
    margin: 0;
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero>.container>* {
    animation: fadeIn 0.8s ease-out forwards;
}

.hero-subtitle {
    animation-delay: 0.2s;
    opacity: 0;
    /* Ensures it stays hidden until animation starts */
}

.hero-actions {
    animation-delay: 0.4s;
    opacity: 0;
    /* Ensures it stays hidden until animation starts */
}

/* Media Queries */
@media (max-width: 768px) {
    .context-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 2rem;
    }

    .problem-item {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
    }

    .problem-number {
        font-size: 2.5rem;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    .accordion-header h4 {
        font-size: 1.1rem;
    }

    .accordion-header {
        padding: 1.25rem 1.5rem;
    }

    .accordion-inner-content {
        padding: 0 1.5rem 1.5rem;
    }

    .template-box {
        padding: 1.5rem;
    }

    .copy-btn {
        position: static;
        width: 100%;
        margin-bottom: 1rem;
        display: block;
    }

    .template-text {
        padding-top: 0;
    }
}