﻿/* ============================================================
   Base Styles (Light Corporate Theme)
   ============================================================ */

:root {
  --brand-primary: #1f3a5f;   /* Deep navy */
  --brand-accent: #3a8fd4;    /* Steel-mid */
  --page-bg: #f4f6f9;         /* Light neutral */
  --card-bg: #ffffff;         /* White cards */
  --border-light: #d9e1ea;
  --text-main: #1e2a38;
  --text-muted: #6b7a8c;

  --success: #3cb371;
  --warning: #f7c948;
  --danger: #e57373;
}

body {
  font-family: "Segoe UI", "Inter", sans-serif;
  margin: 0;
  background: var(--page-bg);
  color: var(--text-main);
}

/* ============================================================
   Header
   ============================================================ */

.header {
  text-align: left;
  padding: 40px 60px 10px;
}

.header h1 {
  font-weight: 600;
  color: var(--brand-primary);
}

.subtitle {
  color: var(--text-muted);
  margin-top: -10px;
}

/* ============================================================
   Info Bar
   ============================================================ */

.snapshot-bar {
  background: white;
  padding: 10px 60px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  color: var(--text-muted);
}

/* ============================================================
   Layout
   ============================================================ */

.main-layout {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 30px;
  padding: 40px 60px;
  align-items: flex-start;
}

/* ============================================================
   Left Column Container
   ============================================================ */

.left-column .container {
  background: var(--card-bg);
  color: var(--text-main);
  border-radius: 16px;
  padding: 36px 40px;
  border: 1px solid var(--border-light);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.intro {
  font-size: 15px;
  margin-bottom: 25px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ============================================================
   Section Titles
   ============================================================ */

.section-label {
  color: var(--brand-primary);
  margin-top: 25px;
  font-weight: 600;
}

.section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ============================================================
   FORM COMPONENT SYSTEM
   ============================================================ */

/* Section wrapper */
.form-section {
  margin-bottom: 32px;
}

/* Row wrapper */
.form-row {
  margin-bottom: 20px;
}

.form-row.inline {
  display: flex;
  gap: 20px;
}

.form-row.inline .form-field {
  flex: 1;
}

/* Field wrapper */
.form-field {
  display: flex;
  flex-direction: column;
}

/* Label */
.form-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 6px;
}

/* Helper text */
.form-helper {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Error text */
.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
}

/* Inputs + Selects */
.form-input,
.form-select {
  width: 100%;
  height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 14px;
  background: #ffffff;
  color: var(--text-main);
  transition: all 0.25s ease;
  box-sizing: border-box;
}

/* Focus */
.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 4px rgba(58, 143, 212, 0.4);
}

/* Disabled */
.form-input:disabled,
.form-select:disabled {
  background: #eef1f5;
  color: #9aa5b5;
  cursor: not-allowed;
}

/* Error state */
.form-input.error,
.form-select.error {
  border-color: var(--danger);
  box-shadow: 0 0 4px rgba(229, 115, 115, 0.3);
}

/* Select dropdown arrow normalization */
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%236b7a8c' height='16' viewBox='0 0 20 20' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M5.516 7.548l4.484 4.484 4.484-4.484L16 8.548l-6 6-6-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

/* Textarea (if needed later) */
.form-textarea {
  width: 100%;
  min-height: 90px;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 14px;
  background: #ffffff;
  color: var(--text-main);
  resize: vertical;
  transition: all 0.25s ease;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 4px rgba(58, 143, 212, 0.4);
}

/* ============================================================
   Right Column
   ============================================================ */

.right-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ============================================================
   Cards (Results + AI Summary)
   ============================================================ */

.results-card,
#ai-summary-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  transition: transform 0.3s ease;
}

.results-card:hover,
#ai-summary-card:hover {
  transform: translateY(-2px);
}

.results-card h2 {
  margin: 0 0 10px;
  color: var(--brand-primary);
}

#risk-category {
  font-weight: 500;
  color: var(--brand-accent);
  font-size: 15px;
}

/* ============================================================
   Risk Bar
   ============================================================ */

#risk-bar-container {
  width: 100%;
  height: 12px;
  background: #e7ebf1;
  border-radius: 8px;
  overflow: hidden;
  margin: 12px 0 10px;
}

#risk-bar {
  height: 100%;
  width: 0%;
  transition: width 0.6s ease, background 0.3s ease;
  border-radius: 8px;
}

/* ============================================================
   Calculation Details
   ============================================================ */

#calc-details {
  margin-top: 12px;
  background: #f7f9fb;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.5;
}

/* ============================================================
   AI Summary Card
   ============================================================ */

#ai-summary-card h3 {
  color: var(--brand-primary);
  margin-top: 0;
}

#ai-summary-text {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

#generate-summary {
  background: var(--brand-accent);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.25s ease;
}

#generate-summary:hover {
  background: #2f7cc1;
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 30px 0 40px;
}

/* ============================================================
   Clear Form Button
   ============================================================ */

#clear-form {
  margin-top: 20px;
  background: transparent;
  color: var(--brand-primary);
  border: 1px solid var(--brand-accent);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
}

#clear-form:hover {
  background: var(--brand-accent);
  color: white;
}

/* ============================================================
   Base Styles (Light Corporate Theme)
   ============================================================ */

:root {
  --brand-primary: #1f3a5f;   /* Deep navy */
  --brand-accent: #3a8fd4;    /* Steel-mid */
  --page-bg: #f4f6f9;         /* Light neutral */
  --card-bg: #ffffff;         /* White cards */
  --border-light: #d9e1ea;
  --text-main: #1e2a38;
  --text-muted: #6b7a8c;

  --success: #3cb371;
  --warning: #f7c948;
  --danger: #e57373;
}

body {
  font-family: "Segoe UI", "Inter", sans-serif;
  margin: 0;
  background: var(--page-bg);
  color: var(--text-main);
}

/* ============================================================
   Header
   ============================================================ */

.header {
  text-align: left;
  padding: 40px 60px 10px;
}

.header h1 {
  font-weight: 600;
  color: var(--brand-primary);
}

.subtitle {
  color: var(--text-muted);
  margin-top: -10px;
}

/* ============================================================
   Info Bar
   ============================================================ */

.snapshot-bar {
  background: white;
  padding: 10px 60px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  color: var(--text-muted);
}

/* ============================================================
   Layout
   ============================================================ */

.main-layout {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 30px;
  padding: 40px 60px;
  align-items: flex-start;
}

/* ============================================================
   Left Column Container
   ============================================================ */

.left-column .container {
  background: var(--card-bg);
  color: var(--text-main);
  border-radius: 16px;
  padding: 36px 40px;
  border: 1px solid var(--border-light);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.intro {
  font-size: 15px;
  margin-bottom: 25px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ============================================================
   Section Titles
   ============================================================ */

.section-label {
  color: var(--brand-primary);
  margin-top: 25px;
  font-weight: 600;
}

.section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ============================================================
   FORM COMPONENT SYSTEM
   ============================================================ */

/* Section wrapper */
.form-section {
  margin-bottom: 32px;
}

/* Row wrapper */
.form-row {
  margin-bottom: 20px;
}

.form-row.inline {
  display: flex;
  gap: 20px;
}

.form-row.inline .form-field {
  flex: 1;
}

/* Field wrapper */
.form-field {
  display: flex;
  flex-direction: column;
}

/* Label */
.form-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 6px;
}

/* Helper text */
.form-helper {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Error text */
.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
}

/* Inputs + Selects */
.form-input,
.form-select {
  width: 100%;
  height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 14px;
  background: #ffffff;
  color: var(--text-main);
  transition: all 0.25s ease;
  box-sizing: border-box;
}

/* Focus */
.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 4px rgba(58, 143, 212, 0.4);
}

/* Disabled */
.form-input:disabled,
.form-select:disabled {
  background: #eef1f5;
  color: #9aa5b5;
  cursor: not-allowed;
}

/* Error state */
.form-input.error,
.form-select.error {
  border-color: var(--danger);
  box-shadow: 0 0 4px rgba(229, 115, 115, 0.3);
}

/* Select dropdown arrow normalization */
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%236b7a8c' height='16' viewBox='0 0 20 20' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M5.516 7.548l4.484 4.484 4.484-4.484L16 8.548l-6 6-6-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

/* Textarea (if needed later) */
.form-textarea {
  width: 100%;
  min-height: 90px;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 14px;
  background: #ffffff;
  color: var(--text-main);
  resize: vertical;
  transition: all 0.25s ease;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 4px rgba(58, 143, 212, 0.4);
}

/* ============================================================
   Right Column
   ============================================================ */

.right-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ============================================================
   Cards (Results + AI Summary)
   ============================================================ */

.results-card,
#ai-summary-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  transition: transform 0.3s ease;
}

.results-card:hover,
#ai-summary-card:hover {
  transform: translateY(-2px);
}

.results-card h2 {
  margin: 0 0 10px;
  color: var(--brand-primary);
}

#risk-category {
  font-weight: 500;
  color: var(--brand-accent);
  font-size: 15px;
}

/* ============================================================
   Risk Bar
   ============================================================ */

#risk-bar-container {
  width: 100%;
  height: 12px;
  background: #e7ebf1;
  border-radius: 8px;
  overflow: hidden;
  margin: 12px 0 10px;
}

#risk-bar {
  height: 100%;
  width: 0%;
  transition: width 0.6s ease, background 0.3s ease;
  border-radius: 8px;
}

/* ============================================================
   Calculation Details
   ============================================================ */

#calc-details {
  margin-top: 12px;
  background: #f7f9fb;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.5;
}

/* ============================================================
   AI Summary Card
   ============================================================ */

#ai-summary-card h3 {
  color: var(--brand-primary);
  margin-top: 0;
}

/* "Coming Soon" label */
.coming-soon {
  font-size: 16px;
  font-weight: 600;
  color: var(--brand-accent);
  margin: 4px 0 12px;
}

/* Summary text */
#ai-summary-text {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Button (default active state) */
#generate-summary {
  background: var(--brand-accent);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.25s ease;
}

/* Hover only when active */
#generate-summary:not(:disabled):hover {
  background: #2f7cc1;
}

/* Disabled state */
#generate-summary:disabled {
  background: #c7d4e3;
  color: #ffffff;
  cursor: not-allowed;
  opacity: 0.7;
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 30px 0 40px;
}

/* ============================================================
   Clear Form Button
   ============================================================ */

#clear-form {
  margin-top: 20px;
  background: transparent;
  color: var(--brand-primary);
  border: 1px solid var(--brand-accent);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
}

#clear-form:hover {
  background: var(--brand-accent);
  color: white;
}

/* Mobile: move results card below the form */
@media (max-width: 640px) {
  .main-layout {
    display: flex;
    flex-direction: column;
  }

  .right-column {
    order: 2; /* ensures it stays below */
  }

  .left-column {
    order: 1;
  }
}
