/* ============================================================
   Qcells Installer Survey — Shared Stylesheet
   Brand: Infinity Navy #001C77 · Tahoe Green #00C6C1 · Green #A1E2B7
   Font: Noto Sans (Qcells brand font for general/web media)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@300;400;600;700;800&display=swap');

/* --- Custom Properties ------------------------------------ */
:root {
  --blue:        #001C77;  /* Infinity Navy — official primary */
  --blue-dark:   #000F47;
  --turquoise:   #00C6C1;  /* Tahoe Green — official primary */
  --teal:        #0095D6;  /* Gradient Color 3 */
  --green:       #A1E2B7;  /* Gradient Color 1 */
  --text:        #1a2340;
  --text-light:  #5a6380;
  --border:      #e2e6ef;
  --bg:          #ffffff;
  --bg-soft:     #f5f7fc;
  --shadow-sm:   0 1px 4px rgba(0, 28, 119, 0.08);
  --shadow-md:   0 4px 16px rgba(0, 28, 119, 0.12);
  --shadow-lg:   0 8px 32px rgba(0, 28, 119, 0.15);
  --radius:      10px;
  --radius-lg:   16px;
  --gradient:    linear-gradient(135deg, #A1E2B7 0%, #00C6C1 33%, #0095D6 67%, #0228A0 100%);
  --font:        'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Header ----------------------------------------------- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.site-header .logo {
  height: 56px;
  width: auto;
}

.site-header .header-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --- Footer ----------------------------------------------- */
.site-footer {
  background: var(--blue);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 1.5rem 2rem;
  font-size: 0.82rem;
  margin-top: auto;
}

.site-footer a { color: rgba(255,255,255,0.9); }
.site-footer .footer-logo { height: 28px; margin: 0 auto 0.75rem; opacity: 0.9; }

/* --- Main Content Area ------------------------------------ */
.page-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

.container--wide {
  max-width: 1100px;
}

/* --- Gradient Accent Bar ---------------------------------- */
.gradient-bar {
  height: 4px;
  background: var(--gradient);
}

/* --- Hero (Landing Page) ---------------------------------- */
.hero {
  background: linear-gradient(160deg, #001C77 0%, #0228A0 60%, #0095D6 100%);
  padding: 5rem 1.5rem 4.5rem;
  text-align: center;
}

.hero .container {
  max-width: 960px;
}

.hero__eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #A1E2B7;
  margin-bottom: 1.1rem;
}

.hero__title {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.hero__subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.82);
  max-width: 680px;
  margin: 0 auto 2.25rem;
  line-height: 1.75;
}

/* --- Gift Card Callout ------------------------------------ */
.gift-callout {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(161, 226, 183, 0.4);
  border-radius: var(--radius);
  padding: 0.875rem 1.25rem;
  max-width: 720px;
  margin: 0 auto 2rem;
  text-align: left;
  backdrop-filter: blur(4px);
}

.gift-callout__icon {
  flex-shrink: 0;
  color: #A1E2B7;
  line-height: 1;
}

.gift-callout__text strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.2rem;
}

.gift-callout__text span {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.78);
}

/* --- Time Estimate ---------------------------------------- */
.time-estimate {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 1.25rem;
}

/* --- Buttons ---------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2.25rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius);
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  text-decoration: none;
}

.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn--primary:hover {
  background: var(--turquoise);
  box-shadow: var(--shadow-lg);
}

.btn--hero {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.btn--hero:hover {
  background: var(--turquoise);
  color: #fff;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.25);
}

.btn--large {
  padding: 1rem 2.75rem;
  font-size: 1.05rem;
  border-radius: 50px;
}

.btn--outline {
  background: transparent;
  color: var(--blue);
  border: 2px solid var(--blue);
}

.btn--outline:hover {
  background: var(--bg-soft);
}

.btn--full { width: 100%; }

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* --- Progress Bar ----------------------------------------- */
.progress-wrap {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* --- Survey Form ------------------------------------------ */
.survey-wrap {
  padding: 2.5rem 1.5rem 4rem;
}

.form-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.form-section__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-section__title .section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--gradient);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: 50%;
  flex-shrink: 0;
}

.form-section__desc {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.field {
  margin-bottom: 1.25rem;
}

.field:last-child { margin-bottom: 0; }

.field > label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

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

.field label .placeholder-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.03em;
}

.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
  width: 100%;
  padding: 0.65rem 0.875rem;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}

.field input[type="text"]:focus,
.field input[type="email"]:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--turquoise);
  box-shadow: 0 0 0 3px rgba(0, 184, 199, 0.15);
}

.field input.error,
.field select.error,
.field textarea.error {
  border-color: #e03e3e;
  box-shadow: 0 0 0 3px rgba(224, 62, 62, 0.1);
}

.field textarea { resize: vertical; min-height: 100px; }

.field-error {
  font-size: 0.8rem;
  color: #e03e3e;
  margin-top: 0.3rem;
  display: none;
}

.field-error.visible { display: block; }

/* --- Radio & Checkbox Groups ------------------------------ */
.radio-group,
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.radio-option,
.checkbox-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

.radio-option:hover,
.checkbox-option:hover {
  border-color: var(--turquoise);
  background: rgba(0, 184, 199, 0.04);
}

.radio-option input,
.checkbox-option input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.radio-option input:checked + span,
.checkbox-option input:checked + span {
  color: var(--blue);
  font-weight: 600;
}

.radio-option:has(input:checked),
.checkbox-option:has(input:checked) {
  border-color: var(--blue);
  background: rgba(2, 50, 165, 0.04);
}

.radio-option span,
.checkbox-option span {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.4;
}

/* --- Rating Scale ----------------------------------------- */
.rating-scale {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.rating-option {
  flex: 1;
  min-width: 44px;
}

.rating-option input { display: none; }

.rating-option label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  min-width: 44px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.rating-option label:hover {
  border-color: var(--turquoise);
  color: var(--turquoise);
}

.rating-option input:checked + label {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.rating-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.4rem;
}

/* --- Submit Area ------------------------------------------ */
.submit-area {
  margin-top: 2rem;
  text-align: center;
}

.submit-notice {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.75rem;
}

.submit-error {
  background: #fff0f0;
  border: 1px solid #ffc5c5;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  color: #c0392b;
  font-size: 0.88rem;
  margin-bottom: 1rem;
  display: none;
}

.submit-error.visible { display: block; }

/* --- Thank You Page --------------------------------------- */
.thankyou-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
}

.thankyou-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  max-width: 520px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.thankyou-icon {
  width: 72px;
  height: 72px;
  background: var(--gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
}

.thankyou-card h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 0.75rem;
}

.thankyou-card .thankyou-message {
  font-size: 0.97rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.thankyou-card .email-highlight {
  font-weight: 700;
  color: var(--blue);
}

.thankyou-divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

.thankyou-card .back-link {
  font-size: 0.88rem;
  color: var(--text-light);
}

/* --- Gift Notice (Thank-You Page) ------------------------- */
.gift-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--turquoise);
  border-radius: var(--radius);
  padding: 0.875rem 1.1rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.gift-notice__icon {
  color: var(--turquoise);
  flex-shrink: 0;
  margin-top: 2px;
}

.gift-notice__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 0.3rem;
}

.gift-notice__text {
  font-size: 0.9rem;
  color: var(--text);
  margin: 0;
  line-height: 1.5;
}

/* --- Dashboard -------------------------------------------- */
.dashboard-header {
  background: var(--blue);
  color: #fff;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dashboard-header .logo { height: 44px; }

.dashboard-header h1 {
  font-size: 1.1rem;
  font-weight: 700;
  opacity: 0.95;
}

.dashboard-header .refresh-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: var(--font);
}

.dashboard-header .refresh-btn:hover { background: rgba(255,255,255,0.25); }

/* Login overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, rgba(0, 28, 119, 0.97) 0%, rgba(2, 40, 160, 0.97) 60%, rgba(0, 149, 214, 0.97) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1.5rem;
}

.login-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.login-card .logo { height: 48px; margin: 0 auto 1.5rem; }

.login-card h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 0.4rem;
}

.login-card p {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.login-card input {
  width: 100%;
  padding: 0.7rem 1rem;
  font-family: var(--font);
  font-size: 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  margin-bottom: 0.75rem;
  text-align: center;
  letter-spacing: 0.05em;
}

.login-card input:focus { border-color: var(--turquoise); }
.login-card .login-error { color: #e03e3e; font-size: 0.82rem; margin-bottom: 0.75rem; display: none; }
.login-card .login-error.visible { display: block; }

/* Dashboard stats */
.dashboard-main { padding: 2rem 1.5rem 4rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.stat-card__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.4rem;
}

.stat-card__value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
}

.stat-card__sub {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.3rem;
}

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.chart-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.chart-card h3 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.chart-container {
  position: relative;
  height: 220px;
}

/* Response table */
.table-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.table-section__header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead tr {
  background: var(--bg-soft);
}

th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-soft); }

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Loading spinner */
.spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Features Section (Landing Page) ---------------------- */
.features {
  padding: 3.5rem 1.5rem;
  background: #fff;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 2rem;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.feature-item__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  background: var(--bg-soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
}

.feature-item__title {
  font-weight: 700;
  color: var(--blue);
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.feature-item__desc {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.55;
}

/* --- Responsive ------------------------------------------- */
@media (max-width: 600px) {
  .site-header { padding: 0 1rem; }
  .hero { padding: 3rem 1rem 3rem; }
  .gift-callout { flex-direction: column; text-align: center; }
  .form-section { padding: 1.25rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .dashboard-header { flex-wrap: wrap; gap: 0.75rem; }
  .thankyou-card { padding: 2rem 1.25rem; }
}
