/**
 * iDuct theme-refresh
 * ---------------------------------------------------------------
 * All new visual styling lives here so it can be reverted by
 * removing 'iduct/refresh' from iduct.info.yml libraries list.
 *
 * Sections:
 *   1. Design tokens (color, type, spacing, shadow)
 *   2. Base typography (Montserrat)
 *   3. Header + site branding
 *   4. Cards (report card, info card, form-item)
 *   5. Buttons
 *   6. Utilities
 */

/* Google Fonts - Montserrat with the weights we use */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

/* ============================================================
 * 1. Design tokens
 * ============================================================ */
:root {
  /* Color palette (from XD spec) */
  --iduct-teal-primary: #00A2D1;
  --iduct-teal-active:  #08B4E6;
  --iduct-teal-light:   #81DEF9;
  --iduct-teal-dark:    #164A5A;

  --iduct-orange-cta:   #C56522;

  --iduct-text-body:    #3E3E3E;
  --iduct-text-heading: #000003;
  --iduct-text-muted:   #A3B4BF;

  --iduct-bg-page:      #FDFDFD;
  --iduct-bg-card:      #FFFFFF;
  --iduct-bg-subtle:    #F8F8F8;

  --iduct-border:       #DCDCDC;
  --iduct-border-soft:  #DCE6EB;

  /* Type */
  --iduct-font:         'Montserrat', system-ui, -apple-system, sans-serif;

  /* Radius */
  --iduct-radius-sm:    5px;
  --iduct-radius-md:    12px;
  --iduct-radius-lg:    25px;
  --iduct-radius-xl:    40px;

  /* Shadow */
  --iduct-shadow-card:  0 4px 12px rgba(0, 0, 0, 0.08);
  --iduct-shadow-hover: 0 6px 18px rgba(0, 0, 0, 0.12);

  /* Logo box */
  --iduct-logo-w: 110px;
  --iduct-logo-h: 66px;
}

/* ============================================================
 * 2. Base typography
 * ============================================================ */
body {
  font-family: var(--iduct-font);
  color: var(--iduct-text-body);
  background: var(--iduct-bg-page);
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6,
.iduct-perm-title {
  font-family: var(--iduct-font);
  color: var(--iduct-text-heading);
  font-weight: 700;
  letter-spacing: 0;
}

h1 { font-size: 40px; line-height: 48px; }
h2 { font-size: 32px; line-height: 39px; font-weight: 400; }
h3 { font-size: 24px; line-height: 29px; }
h4 { font-size: 20px; line-height: 28px; font-weight: 600; }
h5 { font-size: 16px; line-height: 19px; font-weight: 600; }
h6 { font-size: 14px; line-height: 20px; font-weight: 600; }

/* ============================================================
 * 3. Header + site branding
 *    Olivero regions: .site-header wraps the header region
 * ============================================================ */
.site-header,
header.site-header,
.header {
  background: var(--iduct-bg-card);
  border-bottom: 1px solid var(--iduct-border-soft);
  box-shadow: var(--iduct-shadow-card);
}

.site-branding__logo,
.site-branding-logo,
a.site-branding__logo img {
  width: var(--iduct-logo-w);
  height: var(--iduct-logo-h);
  object-fit: contain;
  display: block;
}

.site-branding__name a,
.site-branding-name a {
  font-family: var(--iduct-font);
  font-weight: 700;
  color: var(--iduct-text-heading);
  text-decoration: none;
}

/* ============================================================
 * 4. Cards
 *    .iduct-report-card is used across dashboard, workspace,
 *    project view, and totals - single rule affects all.
 * ============================================================ */
.iduct-report-card {
  background: var(--iduct-bg-card);
  border: 1px solid var(--iduct-border-soft);
  border-radius: var(--iduct-radius-md);
  box-shadow: var(--iduct-shadow-card);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.iduct-report-card__header {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--iduct-border-soft);
}

.iduct-report-card__title {
  margin: 0;
  font-size: 20px;
  line-height: 24px;
  font-weight: 600;
  color: var(--iduct-text-heading);
}

/* Row layout inside cards */
.iduct-report-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--iduct-border-soft);
  align-items: center;
}
.iduct-report-row:last-child {
  border-bottom: none;
}

.iduct-report-row--header {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--iduct-text-muted);
  font-weight: 500;
}

.iduct-report-row--newest {
  background: #E6F7FC;
  border-radius: var(--iduct-radius-sm);
  padding-left: 8px;
  padding-right: 8px;
}

/* Column width helpers (matches classes already used in controllers) */
.iduct-report-col--id    { max-width: 40px; }
.iduct-report-col--check { max-width: 32px; }
.iduct-report-col--date  { max-width: 120px; }

/* Input field wrapper - same treatment as report card, kept separate */
.iduct-input-field {
  background: var(--iduct-bg-card);
  border: 1px solid var(--iduct-border-soft);
  border-radius: var(--iduct-radius-md);
  box-shadow: var(--iduct-shadow-card);
  padding: 20px 24px;
  margin-bottom: 20px;
}

/* Field wrapper - shadow on every form field sitewide.
   Scope later per form ID (e.g. .node-product-form .form-item)
   if products/ducts need to diverge. */
.form-item {
  background: var(--iduct-bg-card);
  border: 1px solid var(--iduct-border-soft);
  border-radius: var(--iduct-radius-sm);
  box-shadow: var(--iduct-shadow-card);
  padding: 12px 16px;
  margin-bottom: 16px;
}

/* Nested form-items (radio/checkbox options inside a fieldset)
   should not get their own shadow - only the top-level wrapper. */
.form-item .form-item,
.fieldset__wrapper .form-item {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin-bottom: 8px;
}

/* ============================================================
 * 5. Buttons
 *    .iduct-btn and .iduct-btn--primary are used throughout.
 * ============================================================ */
.iduct-btn,
a.iduct-btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: var(--iduct-radius-sm);
  font-family: var(--iduct-font);
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.iduct-btn--primary,
a.iduct-btn--primary {
  background: var(--iduct-teal-primary);
  color: #FFFFFF;
}

.iduct-btn--primary:hover,
a.iduct-btn--primary:hover {
  background: var(--iduct-teal-active);
  box-shadow: 0 2px 6px rgba(0, 162, 209, 0.3);
}

.iduct-btn--cta,
a.iduct-btn--cta {
  background: var(--iduct-orange-cta);
  color: #FFFFFF;
}

.iduct-btn--cta:hover {
  background: #A75318;
}

/* Native form submit buttons in workspace form */
.iduct-duct-entry-form input[type="submit"],
form input[type="submit"].form-submit {
  background: var(--iduct-teal-primary);
  color: #FFFFFF;
  border: none;
  padding: 10px 20px;
  border-radius: var(--iduct-radius-sm);
  font-family: var(--iduct-font);
  font-weight: 500;
  cursor: pointer;
}

form input[type="submit"].form-submit:hover {
  background: var(--iduct-teal-active);
}

/* ============================================================
 * 6. Utilities
 * ============================================================ */
.iduct-back-link {
  color: var(--iduct-teal-primary);
  text-decoration: none;
  font-weight: 500;
}
.iduct-back-link:hover {
  text-decoration: underline;
}

.iduct-perm-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.iduct-perm-title {
  margin: 24px 0 16px;
  font-size: 32px;
  line-height: 39px;
  font-weight: 400;
  color: var(--iduct-text-heading);
}

.iduct-members-header {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.iduct-check {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 1px solid var(--iduct-border);
  border-radius: 3px;
}
/* Hide number-input spinners across all browsers */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
