/* ABY Quote Tool — Form (broker-facing UI) */

:root {
  --aby-blue: #1f4e8b;
  --aby-blue-dark: #143b6b;
  --aby-blue-light: #e8eef7;
  --aby-accent: #2c7be5;
  --aby-text: #1f2937;
  --aby-muted: #6b7280;
  --aby-border: #d1d5db;
  --aby-bg: #f7f8fb;
  --aby-card: #ffffff;
  --aby-shaded: #f1f4fa;
  --aby-radius: 10px;
  --aby-radius-sm: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--aby-text);
  background: var(--aby-bg);
  line-height: 1.5;
  font-size: 15px;
}

.app-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 20px 96px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 24px;
  border-bottom: 1px solid var(--aby-border);
  margin-bottom: 24px;
}

.app-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--aby-blue-dark);
  letter-spacing: -0.01em;
}

.app-header h1 .state-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 12px;
  background: var(--aby-blue);
  color: #fff;
  border-radius: 999px;
  vertical-align: middle;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.app-header .subtitle {
  color: var(--aby-muted);
  font-size: 13px;
}

/* ----- Form layout ----- */

form {
  background: var(--aby-card);
  border: 1px solid var(--aby-border);
  border-radius: var(--aby-radius);
  padding: 28px 28px 24px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.form-section {
  margin-bottom: 28px;
}

.form-section:last-of-type { margin-bottom: 0; }

.form-section > h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--aby-muted);
  margin: 0 0 12px;
  font-weight: 600;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 16px;
}

.field-grid.three { grid-template-columns: repeat(3, 1fr); }
.field-grid.full { grid-template-columns: 1fr; }

@media (max-width: 640px) {
  .field-grid, .field-grid.three { grid-template-columns: 1fr; }
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--aby-muted);
  font-weight: 500;
}

label.field input[type="text"],
label.field input[type="email"],
label.field input[type="tel"],
label.field input[type="date"],
label.field input[type="number"],
label.field input[type="file"],
label.field select {
  border: 1px solid var(--aby-border);
  border-radius: var(--aby-radius-sm);
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--aby-text);
  background: #fff;
  width: 100%;
}

label.field input:focus,
label.field select:focus {
  outline: 2px solid var(--aby-accent);
  outline-offset: 1px;
  border-color: var(--aby-accent);
}

label.field .required-mark {
  color: #c0392b;
  margin-left: 2px;
}

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

/* ----- Product selector ----- */

.product-list {
  border: 1px solid var(--aby-border);
  border-radius: var(--aby-radius);
  overflow: hidden;
}

.product-row {
  border-bottom: 1px solid var(--aby-border);
  padding: 12px 16px;
  background: #fff;
}

.product-row:last-child { border-bottom: none; }

.product-row.selected {
  background: var(--aby-blue-light);
}

.product-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-row-head input[type="checkbox"] {
  margin: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--aby-blue);
}

.product-row-head label {
  font-size: 14px;
  font-weight: 500;
  color: var(--aby-text);
  cursor: pointer;
  flex: 1;
}

.product-row-options {
  margin-top: 10px;
  padding-left: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.product-row-options[hidden] { display: none; }

.product-row-options label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--aby-muted);
  font-weight: 500;
}

.product-row-options input,
.product-row-options select {
  border: 1px solid var(--aby-border);
  border-radius: var(--aby-radius-sm);
  padding: 6px 8px;
  font-size: 13px;
  background: #fff;
  font-family: inherit;
  min-width: 180px;
}

.product-row-options input[type="number"] { min-width: 120px; }

.product-row-options input[type="checkbox"] {
  min-width: 0;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: none;
  accent-color: var(--aby-blue);
}

/* ----- Rep selector ----- */

.rep-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.rep-card {
  border: 1.5px solid var(--aby-border);
  border-radius: var(--aby-radius);
  padding: 12px 14px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.12s, background 0.12s;
}

.rep-card:hover { border-color: var(--aby-accent); }

.rep-card.selected {
  border-color: var(--aby-blue);
  background: var(--aby-blue-light);
}

.rep-card input[type="radio"] {
  margin: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--aby-blue);
  flex-shrink: 0;
}

.rep-card-info { line-height: 1.3; }

.rep-card-name {
  font-weight: 600;
  color: var(--aby-text);
  font-size: 14px;
}

.rep-card-title {
  font-size: 12px;
  color: var(--aby-muted);
  margin-top: 2px;
}

/* ----- Commission toggle ----- */

.commission-toggle {
  background: #fff8e1;
  border: 1px solid #f1d27c;
  border-radius: var(--aby-radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.commission-toggle .toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.commission-toggle input[type="checkbox"] {
  margin: 0;
  width: 16px;
  height: 16px;
}

.commission-toggle label {
  font-size: 14px;
  font-weight: 500;
  color: var(--aby-text);
  cursor: pointer;
}

.commission-toggle .helper-text {
  margin-top: 0;
  margin-left: 26px;
}

/* ----- Action buttons ----- */

.actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

button {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--aby-radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s;
}

button.primary {
  background: var(--aby-blue);
  color: #fff;
  border-color: var(--aby-blue-dark);
}

button.primary:hover { background: var(--aby-blue-dark); }

button.secondary {
  background: #fff;
  color: var(--aby-blue-dark);
  border-color: var(--aby-border);
}

button.secondary:hover { background: var(--aby-shaded); }

button.print {
  background: #fff;
  color: var(--aby-text);
  border-color: var(--aby-border);
}

button.print:hover { background: var(--aby-shaded); }

/* ----- Output area ----- */

.output-shell {
  margin-top: 36px;
}

.output-shell:empty { display: none; }

.output-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 16px;
}

/* Quote container styling lives in quote.css so it can also be used standalone */
