/* =========================================================
   CalculateOvertime.com — stylesheet
   Mobile-first, no frameworks
   ========================================================= */

:root {
  --primary: #1a3c5e;        /* Deep navy */
  --accent: #f0a500;         /* Amber/gold */
  --bg: #f5f7fa;             /* Light gray page background */
  --white: #ffffff;
  --text: #2d3748;           /* Dark gray text */
  --text-light: #718096;     /* Secondary text */
  --success: #38a169;        /* Green for results */
  --border: #e2e8f0;
  --weekend-bg: #fafafa;     /* Subtle weekend row distinction in daily grid */
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

/* Author rules below set `display` on several elements that also toggle the
   `hidden` attribute (e.g. .field, .result-row use display: flex). Equal
   specificity would let those rules beat the UA [hidden] rule, so pin it. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3 {
  margin: 0 0 0.5em;
  color: var(--primary);
  line-height: 1.25;
}

h1 { font-size: 1.625rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1.0625rem; font-weight: 600; }

@media (min-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
}

p { margin: 0 0 1em; }

a { color: var(--primary); }

img { max-width: 100%; }

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--primary);
  color: var(--white);
  padding: 1rem 0;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--white);
  font-weight: 700;
  font-size: 1.125rem;
}

.logo-icon {
  flex-shrink: 0;
}

.logo-dotcom {
  color: var(--accent);
}

.tagline {
  margin: 0;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.8);
  flex-basis: 100%;
}

@media (min-width: 600px) {
  .tagline {
    flex-basis: auto;
    margin-left: 0.5rem;
  }
}

/* ---------- Hero ---------- */
.hero {
  padding: 1.75rem 0 1rem;
  text-align: left;
}

.subheadline {
  color: var(--text-light);
  font-size: 1rem;
  max-width: 65ch;
}

/* ---------- Layout grid ---------- */
.layout-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.layout-main {
  min-width: 0;
}

/* ---------- Calculator card ---------- */
.calculator-card {
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(26, 60, 94, 0.08);
  padding: 24px;
  margin-bottom: 1.5rem;
}

/* Mode toggle (pill style) */
.mode-toggle {
  display: inline-flex;
  background: var(--border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 1.5rem;
}

.mode-toggle button {
  border: none;
  border-radius: 999px;
  padding: 8px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-toggle button.active {
  background: var(--primary);
  color: var(--white);
}

.mode-toggle button:not(.active) {
  background: transparent;
  color: var(--text-light);
}

.mode-toggle button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Form fields */
.input-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

@media (min-width: 560px) {
  .input-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.field {
  display: flex;
  flex-direction: column;
}

.field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.field input[type="number"],
.field input[type="text"],
.field select {
  height: 48px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23718096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 165, 0, 0.25);
}

.field-help { margin: 0.25rem 0 0; font-size: 0.8125rem; color: var(--text-light); }

.prefixed-input {
  display: inline-flex;
  align-items: center;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  padding: 0 0.75rem;
  min-height: 48px;
}

.field .prefixed-input input[type="number"] {
  border: none;
  border-radius: 0;
  background: transparent;
  width: 100%;
  min-width: 0;
  padding: 0;
  margin: 0;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  height: 48px;
}

.prefix-symbol {
  flex-shrink: 0;
  margin-right: 0.375rem;
  color: var(--text-light);
  font-size: 1rem;
}

.prefixed-input input:focus {
  outline: none;
}

.prefixed-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 165, 0, 0.15);
}

.nevada-wage-note {
  color: var(--primary);
  font-style: normal;
  background: #fff8e6;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
}

/* Mode sections */
.mode-section {
  margin-top: 0.5rem;
}

.mode-note {
  font-size: 0.8125rem;
  color: var(--text-light);
  font-style: italic;
  margin: 0.5rem 0 0;
}

/* What-if slider */
.what-if {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.what-if label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.what-if-value {
  color: var(--primary);
  font-weight: 700;
}

.what-if input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.what-if-result {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary);
}

/* ---------- Daily hours grid ---------- */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.daily-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.daily-grid caption {
  text-align: left;
}

.daily-grid th,
.daily-grid td {
  padding: 0.625rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.daily-grid thead th {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.daily-grid tbody tr:nth-child(odd) {
  background: #fcfdfe;
}

.daily-grid tr.weekend-row {
  background: var(--weekend-bg);
}

.daily-grid input[type="number"] {
  width: 5.5rem;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 10px;
  font-size: 0.9375rem;
  font-family: inherit;
}

.daily-grid input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 165, 0, 0.25);
}

.daily-grid .breakdown {
  font-size: 0.8125rem;
  color: var(--text-light);
  white-space: nowrap;
}

.daily-grid tfoot th,
.daily-grid tfoot td {
  border-bottom: none;
  border-top: 2px solid var(--border);
  font-weight: 700;
  color: var(--primary);
}

.col-breakdown {
  white-space: nowrap;
}

@media (max-width: 600px) {
  .col-breakdown {
    display: none;
  }
  .daily-grid tbody tr {
    cursor: pointer;
  }
  .daily-grid tbody tr.show-breakdown .col-breakdown {
    display: table-cell;
  }
}

.seventh-day-callout {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  background: #fff8e6;
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 500;
}

/* ---------- Results panel ---------- */
.results-panel {
  background: #f0fff4;
  border-left: 4px solid var(--success);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 1.5rem;
}

.results-panel h2 {
  margin-bottom: 1rem;
}

.results-list {
  margin: 0;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.4rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(56, 161, 105, 0.15);
}

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

.result-row dt {
  color: var(--text);
  font-weight: 500;
  font-size: 0.9375rem;
}

.result-row dd {
  margin: 0;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}

.period-tag,
.ca-tag {
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--text-light);
}

.result-total {
  font-size: 1.25rem;
  font-weight: 700;
}

.result-total dt,
.result-total dd {
  color: var(--success);
  font-weight: 700;
}

.callout {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  background: rgba(56, 161, 105, 0.1);
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--success);
}

.callout:empty {
  display: none;
}

.annual-projection {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(56, 161, 105, 0.25);
}

.results-panel .what-if {
  border-top-color: rgba(56, 161, 105, 0.25);
}

.validation-warning {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #fff5f5;
  border-left: 4px solid #e53e3e;
  border-radius: 4px;
  color: #c53030;
  font-size: 0.875rem;
  font-weight: 500;
}

.reset-btn {
  margin-top: 1.5rem;
  background: var(--white);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 10px 24px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.reset-btn:hover {
  background: var(--primary);
  color: var(--white);
}

.reset-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- FAQ ---------- */
.faq {
  margin: 2rem 0;
}

.faq-heading {
  margin-bottom: 1.25rem;
}

.faq-item {
  background: var(--white);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 4px rgba(26, 60, 94, 0.05);
}

.faq-item h2 {
  font-size: 1.0625rem;
}

.faq-item p {
  margin-bottom: 0;
  color: var(--text);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.75);
  padding: 1.5rem 0;
  margin-top: 2rem;
}

.site-footer p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.6;
}

/* ---------- Larger desktop centering ---------- */
@media (min-width: 1024px) {
  .container {
    max-width: 960px;
  }
}
