/* ===== CSS Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --c-sun: #E85D26;
  --c-sun-light: #FFF3ED;
  --c-sun-dark: #B8441A;
  --c-sky: #1A3A5C;
  --c-sky-light: #E8F0F8;
  --c-sky-mid: #B8D0E8;
  --c-white: #FFFFFF;
  --c-gray-50: #F8F9FA;
  --c-gray-100: #F1F3F5;
  --c-gray-200: #E9ECEF;
  --c-gray-300: #DEE2E6;
  --c-gray-500: #868E96;
  --c-gray-700: #495057;
  --c-gray-900: #212529;
  --c-green: #2E7D4F;
  --c-green-light: #E8F5EE;
  --c-amber: #E8A817;
  --c-amber-light: #FFF8E1;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --max-width: 1120px;
  --header-height: 60px;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 16px); }
body { font-family: var(--font-sans); color: var(--c-gray-900); background: var(--c-white); line-height: 1.6; -webkit-font-smoothing: antialiased; }

a { color: var(--c-sun); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

.skip-link { position: absolute; top: -100%; left: 16px; background: var(--c-sun); color: var(--c-white); padding: 8px 16px; border-radius: 0 0 var(--radius) var(--radius); z-index: 1000; font-weight: 600; }
.skip-link:focus { top: 0; }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ===== Header ===== */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--c-white); border-bottom: 1px solid var(--c-gray-200); height: var(--header-height); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.15rem; color: var(--c-gray-900); }
.logo:hover, .logo:focus-visible { text-decoration: none; }
.logo-accent { color: var(--c-sun); }
.site-nav ul { display: flex; list-style: none; gap: 24px; }
.nav-link { font-size: 0.9rem; font-weight: 500; color: var(--c-gray-700); padding: 4px 0; border-bottom: 2px solid transparent; transition: color 0.15s, border-color 0.15s; }
.nav-link:hover, .nav-link:focus-visible { color: var(--c-sun); border-bottom-color: var(--c-sun); text-decoration: none; }

/* ===== Hero ===== */
.hero { background: linear-gradient(135deg, var(--c-sun-light) 0%, var(--c-sky-light) 100%); padding: 64px 0 56px; }
.hero-content { max-width: 640px; }
.hero h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.2; font-weight: 800; color: var(--c-gray-900); margin-bottom: 16px; }
.hero-sub { font-size: 1.1rem; color: var(--c-gray-700); margin-bottom: 24px; line-height: 1.5; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.hero-meta { font-size: 0.85rem; color: var(--c-gray-500); }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border-radius: var(--radius); font-size: 0.95rem; font-weight: 600; cursor: pointer; border: 2px solid transparent; transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s; text-decoration: none; }
.btn:hover, .btn:focus-visible { text-decoration: none; }
.btn-primary { background: var(--c-sun); color: var(--c-white); border-color: var(--c-sun); }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--c-sun-dark); border-color: var(--c-sun-dark); }
.btn-ghost { background: transparent; color: var(--c-sun); border-color: var(--c-sun); }
.btn-ghost:hover, .btn-ghost:focus-visible { background: var(--c-sun-light); }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Section Styles ===== */
section { padding: 56px 0; }
.section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.section-sub { color: var(--c-gray-500); margin-bottom: 32px; max-width: 600px; }

/* ===== Planner ===== */
.planner-section { background: var(--c-gray-50); }
.planner-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }

.planner-form-panel { background: var(--c-white); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm); border: 1px solid var(--c-gray-200); }

.form-group { border: none; margin-bottom: 24px; }
.form-legend { font-size: 1rem; font-weight: 700; color: var(--c-sky); margin-bottom: 12px; padding: 0; }
.field-row { margin-bottom: 12px; }
.field-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--c-gray-700); margin-bottom: 4px; }
.field-label-inline { font-size: 0.9rem; color: var(--c-gray-700); cursor: pointer; }
.field-select, .field-input { width: 100%; padding: 8px 12px; border: 1px solid var(--c-gray-300); border-radius: var(--radius); font-size: 0.9rem; font-family: var(--font-sans); background: var(--c-white); color: var(--c-gray-900); }
.field-select:focus, .field-input:focus { outline: none; border-color: var(--c-sun); box-shadow: 0 0 0 3px rgba(232,93,38,0.15); }
.field-hint { font-size: 0.8rem; color: var(--c-gray-500); display: block; margin-top: 2px; }
.field-checkbox { width: 18px; height: 18px; accent-color: var(--c-sun); margin-right: 8px; vertical-align: middle; }
.checkbox-row { display: flex; align-items: center; margin-bottom: 8px; }
.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }

.form-actions { display: flex; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--c-gray-200); }

/* ===== Output Panel ===== */
.planner-output-panel { background: var(--c-white); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm); border: 1px solid var(--c-gray-200); position: sticky; top: calc(var(--header-height) + 20px); max-height: calc(100vh - var(--header-height) - 40px); overflow-y: auto; }
.output-title { font-size: 1.1rem; font-weight: 700; color: var(--c-sky); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--c-sun-light); }
.plan-output { min-height: 200px; }
.plan-placeholder { color: var(--c-gray-500); font-style: italic; padding: 24px; text-align: center; background: var(--c-gray-50); border-radius: var(--radius); border: 2px dashed var(--c-gray-300); }

.plan-section { margin-bottom: 20px; }
.plan-section h4 { font-size: 0.95rem; font-weight: 700; color: var(--c-sky); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.plan-section h4 .icon { font-size: 1.1rem; }
.plan-section ul, .plan-section ol { padding-left: 20px; margin-bottom: 8px; }
.plan-section li { font-size: 0.9rem; margin-bottom: 4px; line-height: 1.5; }
.plan-badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge-high { background: #FDE8E8; color: #C92A2A; }
.badge-med { background: var(--c-amber-light); color: #856404; }
.badge-low { background: var(--c-green-light); color: var(--c-green); }
.badge-info { background: var(--c-sky-light); color: var(--c-sky); }

.plan-room-card { background: var(--c-gray-50); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; border-left: 4px solid var(--c-sun); }
.plan-room-card h5 { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.plan-room-card p { font-size: 0.85rem; color: var(--c-gray-700); }

.checklist { list-style: none; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; margin-bottom: 6px; }
.checklist input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--c-green); flex-shrink: 0; }

.plan-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--c-gray-200); }

/* ===== Guide ===== */
.guide-section { background: var(--c-white); }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 40px; }
.guide-card { background: var(--c-gray-50); border-radius: var(--radius-lg); padding: 24px; border: 1px solid var(--c-gray-200); }
.guide-card h3 { font-size: 1rem; font-weight: 700; color: var(--c-sky); margin-bottom: 8px; }
.guide-card p { font-size: 0.9rem; color: var(--c-gray-700); line-height: 1.5; }

.guide-details { max-width: 720px; }
.guide-details h3 { font-size: 1.1rem; font-weight: 700; color: var(--c-sky); margin: 28px 0 12px; }
.guide-details ul { padding-left: 20px; margin-bottom: 16px; }
.guide-details li { font-size: 0.9rem; margin-bottom: 6px; line-height: 1.5; }
.guide-details p { font-size: 0.9rem; color: var(--c-gray-700); line-height: 1.6; margin-bottom: 12px; }

/* ===== Example ===== */
.example-section { background: var(--c-sky-light); }
.example-plan { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.example-card { background: var(--c-white); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); }
.example-card h3 { font-size: 1rem; font-weight: 700; color: var(--c-sky); margin-bottom: 10px; }
.example-card ul, .example-card ol { padding-left: 20px; }
.example-card li { font-size: 0.9rem; margin-bottom: 6px; line-height: 1.5; }
.cost-note { font-size: 0.8rem; color: var(--c-gray-500); margin-top: 10px; font-style: italic; }

/* ===== FAQ ===== */
.faq-section { background: var(--c-white); }
.faq-list { max-width: 720px; }
.faq-item { border-bottom: 1px solid var(--c-gray-200); }
.faq-question { width: 100%; text-align: left; background: none; border: none; font-size: 1rem; font-weight: 600; color: var(--c-gray-900); padding: 16px 0; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-family: var(--font-sans); }
.faq-question::after { content: '+'; font-size: 1.2rem; color: var(--c-sun); flex-shrink: 0; margin-left: 12px; transition: transform 0.2s; }
.faq-question[aria-expanded="true"]::after { content: '−'; }
.faq-question:hover, .faq-question:focus-visible { color: var(--c-sun); outline: none; }
.faq-answer { font-size: 0.9rem; color: var(--c-gray-700); line-height: 1.6; padding-bottom: 16px; }
.faq-answer[hidden] { display: none; }

/* ===== Footer ===== */
.site-footer { background: var(--c-gray-900); color: var(--c-gray-300); padding: 40px 0; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 32px; }
.footer-brand .logo-text { color: var(--c-white); font-size: 1.1rem; }
.footer-tagline { font-size: 0.85rem; color: var(--c-gray-500); margin-top: 4px; }
.footer-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 16px; }
.footer-nav a { color: var(--c-gray-300); font-size: 0.85rem; }
.footer-nav a:hover, .footer-nav a:focus-visible { color: var(--c-white); }
.footer-meta { grid-column: 1 / -1; font-size: 0.8rem; color: var(--c-gray-500); border-top: 1px solid var(--c-gray-700); padding-top: 16px; }
.footer-meta a { color: var(--c-gray-300); }

/* ===== Print Styles ===== */
@media print {
  .site-header, .site-footer, .planner-form-panel, .plan-actions, .hero-actions, .hero-meta, .faq-section, .example-section { display: none !important; }
  .planner-layout { display: block; }
  .planner-output-panel { position: static; box-shadow: none; border: none; padding: 0; max-height: none; overflow: visible; }
  body { font-size: 12pt; }
  .plan-room-card { break-inside: avoid; }
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .planner-layout { grid-template-columns: 1fr; }
  .planner-output-panel { position: static; max-height: none; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 32px; }
  section { padding: 40px 0; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .planner-form-panel, .planner-output-panel { padding: 18px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .site-nav ul { gap: 14px; }
  .nav-link { font-size: 0.8rem; }
}

/* ===== Focus Styles ===== */
*:focus-visible { outline: 2px solid var(--c-sun); outline-offset: 2px; }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--c-gray-900); color: var(--c-white); padding: 12px 20px; border-radius: var(--radius); font-size: 0.9rem; box-shadow: var(--shadow-lg); z-index: 200; opacity: 0; transform: translateY(10px); transition: opacity 0.3s, transform 0.3s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateY(0); }


/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
