/* ── Rooster Brand Font (Howdens) ── */
@font-face {
  font-family: 'Rooster';
  src: url('/fonts/Rooster-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Rooster';
  src: url('/fonts/Rooster-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Rooster';
  src: url('/fonts/Rooster-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Rooster';
  src: url('/fonts/Rooster-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Rooster';
  src: url('/fonts/Rooster-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Rooster';
  src: url('/fonts/Rooster-BlackItalic.woff2') format('woff2');
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Rooster';
  src: url('/fonts/Rooster-Condensed.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-stretch: condensed;
  font-display: swap;
}
@font-face {
  font-family: 'Rooster';
  src: url('/fonts/Rooster-CondensedBold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-stretch: condensed;
  font-display: swap;
}
@font-face {
  font-family: 'Rooster';
  src: url('/fonts/Rooster-CondensedItalic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-stretch: condensed;
  font-display: swap;
}

/* Howdens Fire Door Portal — Brand Styles */

:root {
  /* Howdens Official Brand Palette (from 2022 Brand Guidelines) */
  --howdens-red: #D22630;
  --howdens-red-dark: #A81E26;
  --howdens-red-light: #FDE0E2;
  --howdens-black: #000000;
  --howdens-grey: #F5F5F5;
  --howdens-grey-mid: #A4A4A4;
  --howdens-grey-dark: #646363;
  --howdens-white: #FFFFFF;
  --howdens-cream: #F5F0E3;
  --howdens-blue: #28343C;
  --green: #16A34A;
  --green-light: #DCFCE7;
  --amber: #EAB308;
  --amber-light: #FEF9C3;
  --red: #DC2626;
  --red-light: #FEE2E2;
  --blue: #2563EB;
  --font: 'Rooster', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--howdens-grey);
  color: var(--howdens-black);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Header ── */
.header {
  background: white;
  color: #333;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header .howdens-logo-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.header .howdens-logo-inline svg.rooster-icon {
  flex-shrink: 0;
}

.header .howdens-logo-inline .howdens-text {
  font-family: 'Rooster', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: #000;
  letter-spacing: 2.5px;
  line-height: 1;
}

.header .logo-accent-divider {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: #ccc;
  margin: 0 8px;
}

.header .logo-fire {
  font-size: 26px;
}

.header .logo-accent {
  color: var(--howdens-red);
}

.header .nav-links a {
  color: #555;
}

.header .logo .section-label {
  color: #888;
}

.header .nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.header .nav-links a {
  color: #ccc;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.header .nav-links a:hover { color: white; }

.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  font-family: var(--font);
}

.btn-primary {
  background: var(--howdens-red);
  color: white;
}

.btn-primary:hover {
  background: var(--howdens-red-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: white;
  color: var(--howdens-black);
  border: 2px solid #ddd;
}

.btn-secondary:hover {
  border-color: var(--howdens-red);
  color: var(--howdens-red);
}

.btn-green {
  background: var(--green);
  color: white;
}

.btn-green:hover {
  background: #15803D;
}

.btn-outline {
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.3);
}

.btn-outline:hover {
  border-color: var(--howdens-red);
  color: var(--howdens-red);
}

.btn-sm { padding: 6px 14px; font-size: 13px; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ── Containers ── */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 20px;
}

.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
  font-weight: 600;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body { padding: 24px; }

/* ── Status Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-green { background: var(--green-light); color: var(--green); }
.badge-amber { background: var(--amber-light); color: #A16207; }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-blue { background: #DBEAFE; color: var(--blue); }
.badge-grey { background: #F3F4F6; color: var(--howdens-grey-dark); }

/* ── Door Hero ── */
.door-hero {
  background: var(--howdens-black);
  color: white;
  padding: 40px 24px;
  text-align: center;
}

.door-hero h1 { font-size: 28px; margin-bottom: 8px; }
.door-hero .door-sku { color: var(--howdens-grey-mid); font-size: 16px; margin-bottom: 16px; }
.door-hero .door-certs { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Action Grid ── */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

.action-card {
  background: white;
  border: 2px solid #eee;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--howdens-black);
}

.action-card:hover {
  border-color: var(--howdens-red);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(210,38,48,0.1);
}

.action-card .icon { font-size: 32px; margin-bottom: 12px; }
.action-card h3 { font-size: 16px; margin-bottom: 4px; }
.action-card p { font-size: 13px; color: var(--howdens-grey-dark); }

/* ── Installation Steps ── */
.install-steps {
  list-style: none;
}

.install-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #eee;
}

.install-step:last-child { border-bottom: none; }

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.step-pending { background: #f0f0f0; color: #999; }
.step-active { background: var(--howdens-red); color: white; }
.step-done { background: var(--green); color: white; }

.step-content { flex: 1; }
.step-content h4 { font-size: 15px; margin-bottom: 4px; }
.step-content p { font-size: 13px; color: var(--howdens-grey-dark); }

/* ── Hardware Scan ── */
.hardware-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 8px;
}

.hardware-item.compatible { border-left: 4px solid var(--green); }
.hardware-item.incompatible { border-left: 4px solid var(--red); }

/* ── Dashboard ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.stat-card .stat-number { font-size: 32px; font-weight: 700; }
.stat-card .stat-label { font-size: 13px; color: var(--howdens-grey-dark); margin-top: 4px; }
.stat-green .stat-number { color: var(--green); }
.stat-amber .stat-number { color: var(--amber); }
.stat-red .stat-number { color: var(--red); }
.stat-blue .stat-number { color: var(--blue); }

.door-table {
  width: 100%;
  border-collapse: collapse;
}

.door-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--howdens-grey-dark);
  border-bottom: 2px solid #eee;
  font-weight: 600;
}

.door-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.door-table tr:hover td { background: #FAFAFA; }

/* ── Form Elements ── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--howdens-black);
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font);
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.form-group input[style*="flex:"] {
  width: auto;
  min-width: 0;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--howdens-red);
}

/* ── QR Display ── */
.qr-display {
  background: white;
  border: 2px dashed #ddd;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.qr-display img { max-width: 200px; height: auto; }

/* ── Scanner Overlay ── */
.scanner-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.scanner-overlay.active { display: flex; }

.scanner-box {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.scanner-box h3 { margin-bottom: 16px; }
.scanner-box .scanner-input {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  text-align: center;
  margin-bottom: 16px;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.active { display: flex; }

.modal {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal h2 { margin-bottom: 16px; }

/* ── Alert / Messages ── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-success { background: var(--green-light); color: var(--green); }
.alert-error { background: var(--red-light); color: var(--red); }
.alert-info { background: #DBEAFE; color: var(--blue); }

/* ── Certificate ── */
.certificate {
  border: 2px solid var(--howdens-black);
  padding: 32px;
  max-width: 600px;
  margin: 0 auto;
}

.certificate h2 { text-align: center; margin-bottom: 24px; }
.certificate .cert-field { margin-bottom: 12px; }
.certificate .cert-field label { font-weight: 600; font-size: 12px; color: var(--howdens-grey-dark); text-transform: uppercase; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .action-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .header { flex-direction: column; gap: 12px; }
  .door-table { font-size: 13px; }
  .door-table th, .door-table td { padding: 8px 10px; }
}

/* ── Misc ── */
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }

.divider {
  height: 1px;
  background: #eee;
  margin: 24px 0;
}

.inspection-checklist label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  cursor: pointer;
  font-size: 14px;
}

.inspection-checklist input[type="radio"] { margin: 0; }
