/* === FleetMatch – Brand Design System === */

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

:root {
  /* Brand colors from logo */
  --fm-navy: #1A2332;
  --fm-navy-light: #2D3748;
  --fm-blue: #2B7DE9;
  --fm-blue-light: #5BA3F5;
  --fm-red: #E63946;
  --fm-red-dark: #C62D39;

  /* UI colors */
  --fm-green: #25D366;
  --fm-green-dark: #1EBE5A;
  --fm-bg: #F0F2F5;
  --fm-card: #FFFFFF;
  --fm-text: #0A1628;
  --fm-text-secondary: #5A6478;
  --fm-text-muted: #8B95A5;
  --fm-border: #E2E6EC;
  --fm-border-light: #F0F2F5;

  /* Design tokens */
  --fm-radius: 14px;
  --fm-radius-sm: 10px;
  --fm-radius-lg: 20px;
  --fm-shadow-sm: 0 1px 3px rgba(10, 22, 40, 0.06);
  --fm-shadow: 0 2px 12px rgba(10, 22, 40, 0.08);
  --fm-shadow-lg: 0 8px 30px rgba(10, 22, 40, 0.12);
  --fm-shadow-glow: 0 4px 20px rgba(74, 159, 229, 0.2);
  --fm-transition: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--fm-bg);
  color: var(--fm-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === HEADER === */

.fm-header {
  background: #FFFFFF;
  color: var(--fm-text);
  padding: 28px 16px 22px;
  text-align: center;
  position: relative;
  border-bottom: 1px solid var(--fm-border);
  width: 100%;
  max-width: 100vw;
}

.fm-header__logo-img {
  height: 64px;
  width: auto;
  max-width: 80%;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
  object-fit: contain;
}

.fm-header__subtitle {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fm-text-secondary);
  margin-top: 2px;
  position: relative;
  z-index: 1;
  letter-spacing: 0.2px;
}

.fm-header__plate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(43, 125, 233, 0.08);
  border: 1.5px solid rgba(43, 125, 233, 0.2);
  border-radius: 8px;
  padding: 6px 16px;
  margin-top: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--fm-text);
  position: relative;
  z-index: 1;
}

.fm-header__plate::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fm-green);
  box-shadow: 0 0 6px rgba(37, 211, 102, 0.5);
}

/* === EMERGENCY BANNER === */

.fm-emergency {
  background: linear-gradient(90deg, var(--fm-red) 0%, var(--fm-red-dark) 100%);
  color: #fff;
  text-align: center;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.fm-emergency a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* === CONTAINER === */

.fm-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  width: 100%;
}

/* === CARDS === */

.fm-card {
  background: var(--fm-card);
  border-radius: var(--fm-radius);
  border: 1px solid var(--fm-border);
  padding: 16px;
  margin-bottom: 14px;
  overflow: hidden;
}

.fm-card__title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fm-text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fm-card__title::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--fm-blue);
  border-radius: 2px;
}

/* === CONTACT BLOCK === */

.fm-contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--fm-border-light);
  font-size: 0.93rem;
  text-decoration: none;
  color: var(--fm-text);
  transition: color var(--fm-transition);
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}

.fm-contact-row:hover {
  color: var(--fm-blue);
}

.fm-contact-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.fm-contact-row__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--fm-radius-sm);
  background: rgba(74, 159, 229, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fm-contact-row svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--fm-blue);
}

/* === BUTTONS === */

.fm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: var(--fm-radius);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--fm-transition), box-shadow var(--fm-transition), background var(--fm-transition);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.fm-btn:active {
  transform: scale(0.97);
}

.fm-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* WhatsApp */
.fm-btn--whatsapp {
  background: var(--fm-green);
  color: #fff;
  margin-bottom: 10px;
}

.fm-btn--whatsapp:hover {
  background: var(--fm-green-dark);
}

/* Policy */
.fm-btn--policy {
  background: var(--fm-blue);
  color: #fff;
  margin-bottom: 10px;
}

.fm-btn--policy:hover {
  background: var(--fm-blue-light);
}

/* Portal */
.fm-btn--portal {
  background: var(--fm-navy);
  color: #fff;
}

.fm-btn--portal:hover {
  background: var(--fm-navy-light);
}

/* Insurance */
.fm-btn--insurance {
  background: #fff;
  color: var(--fm-navy);
  border: 2px solid var(--fm-border);
}

.fm-btn--insurance:hover {
  border-color: var(--fm-blue);
  color: var(--fm-blue);
}

/* Outline */
.fm-btn--outline {
  background: #fff;
  color: var(--fm-text);
  border: 2px solid var(--fm-border);
}

/* === SCENARIO BUTTONS === */

.fm-scenarios {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fm-scenario-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--fm-border);
  border-radius: var(--fm-radius);
  padding: 14px 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--fm-transition), box-shadow var(--fm-transition), transform var(--fm-transition);
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}

.fm-scenario-btn:hover,
.fm-scenario-btn:focus {
  border-color: var(--fm-blue);
  background: #F8FBFF;
  outline: none;
}

.fm-scenario-btn:active {
  transform: translateY(0);
}

.fm-scenario-btn__icon {
  width: 46px;
  height: 46px;
  border-radius: var(--fm-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.3rem;
}

.fm-scenario-btn__icon--tire {
  background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
}
.fm-scenario-btn__icon--window {
  background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
}
.fm-scenario-btn__icon--car-minor {
  background: linear-gradient(135deg, #FFF8E1, #FFECB3);
}
.fm-scenario-btn__icon--car-collision {
  background: linear-gradient(135deg, #FFE0B2, #FFCC80);
}
.fm-scenario-btn__icon--accident-solo {
  background: linear-gradient(135deg, #FFEBEE, #FFCDD2);
}
.fm-scenario-btn__icon--accident-multi {
  background: linear-gradient(135deg, #FFCDD2, #EF9A9A);
}

.fm-scenario-btn__text {
  flex: 1;
  min-width: 0;
}

.fm-scenario-btn__title {
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--fm-text);
  line-height: 1.3;
}

.fm-scenario-btn__desc {
  font-size: 0.8rem;
  color: var(--fm-text-muted);
  margin-top: 2px;
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: break-word;
}

.fm-scenario-btn__arrow {
  color: var(--fm-text-muted);
  flex-shrink: 0;
  transition: transform var(--fm-transition), color var(--fm-transition);
}

.fm-scenario-btn:hover .fm-scenario-btn__arrow {
  color: var(--fm-blue);
  transform: translateX(2px);
}

/* === SCENARIO OVERLAY === */

.fm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(26, 35, 50, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.fm-overlay.active {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.fm-overlay__sheet {
  background: #fff;
  border-radius: var(--fm-radius-lg) var(--fm-radius-lg) 0 0;
  padding: 20px 20px 34px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  animation: slideUp 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 -4px 40px rgba(10, 22, 40, 0.2);
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.fm-overlay__handle {
  width: 36px;
  height: 4px;
  background: var(--fm-border);
  border-radius: 2px;
  margin: 0 auto 18px;
}

.fm-overlay__title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--fm-navy);
}

.fm-overlay__desc {
  color: var(--fm-text-secondary);
  margin-bottom: 20px;
  font-size: 0.93rem;
  line-height: 1.5;
}

.fm-steps {
  list-style: none;
  counter-reset: step;
}

.fm-steps li {
  counter-increment: step;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--fm-border-light);
  font-size: 0.93rem;
  color: var(--fm-text-secondary);
  line-height: 1.5;
}

.fm-steps li:last-child {
  border-bottom: none;
}

.fm-steps li::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--fm-navy) 0%, var(--fm-navy-light) 100%);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.fm-overlay__actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fm-btn--close {
  background: var(--fm-bg);
  color: var(--fm-text-secondary);
  font-weight: 500;
}

.fm-btn--close:hover {
  background: var(--fm-border);
}

/* === RED ACCENT DECORATION === */

.fm-card--highlight {
  border-top: 3px solid var(--fm-blue);
}

/* === LOADING STATE === */

.fm-loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--fm-text-muted);
}

.fm-loading__spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--fm-border);
  border-top-color: var(--fm-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 16px;
}

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

/* === ERROR STATE === */

.fm-error {
  text-align: center;
  padding: 60px 20px;
}

.fm-error__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFEBEE, #FFCDD2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.8rem;
}

.fm-error__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--fm-navy);
}

.fm-error__desc {
  color: var(--fm-text-muted);
  margin-bottom: 24px;
  font-size: 0.93rem;
  line-height: 1.5;
}

/* === FOOTER === */

.fm-footer {
  text-align: center;
  padding: 28px 16px 36px;
  color: var(--fm-text-muted);
  font-size: 0.78rem;
  line-height: 1.8;
}

.fm-footer a {
  color: var(--fm-blue);
  text-decoration: none;
  font-weight: 500;
}

.fm-footer a:hover {
  text-decoration: underline;
}

.fm-footer__divider {
  width: 40px;
  height: 2px;
  background: var(--fm-border);
  border-radius: 1px;
  margin: 12px auto;
}

/* === UTILITY === */

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

/* === SAFE AREA (iPhone notch) === */

@supports (padding-top: env(safe-area-inset-top)) {
  .fm-header {
    padding-top: calc(24px + env(safe-area-inset-top));
  }
  .fm-footer {
    padding-bottom: calc(36px + env(safe-area-inset-bottom));
  }
}
