/* ============================================
   Ekipate Widget – Quotation Form Styles
   ============================================ */

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

/* ---------- CSS Custom Properties ---------- */
:root {
  --bg-primary: #020407;
  --bg-secondary: #1a2338;
  --bg-card: #ffffff;
  --bg-input: #f6f8fb;
  --bg-input-focus: #fff;
  --border-default: #dce1ea;
  --border-focus: rgba(26, 109, 200, 0.45);
  --border-selected: #1a6dc8;
  --text-primary: #111827;
  --text-secondary: #4b5568;
  --text-muted: #9ba1b0;
  --accent: #1a6dc8;
  --accent-glow: rgba(26, 109, 200, 0.15);
  --accent-hover: #1e80e8;
  --success: #16a34a;
  --success-bg: rgba(22, 163, 74, 0.08);
  --error: #dc2626;
  --error-bg: rgba(220, 38, 38, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-card: 0 8px 40px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-input: 0 1px 2px rgba(0, 0, 0, 0.06);
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow-x: hidden;
}


/* ---------- Widget Container ---------- */
.widget-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
}

/* ---------- Card ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 36px 32px 32px;
  box-shadow: var(--shadow-card);
}

/* ---------- Header ---------- */
.header {
  text-align: center;
  margin-bottom: 32px;
}

.header__logo {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.header__subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ---------- Form ---------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- Form Group ---------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group__label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.form-group__input,
.form-group__select {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.9375rem;
  color: var(--text-primary);
  font-family: inherit;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-input);
  outline: none;
  width: 100%;
}

.form-group__input::placeholder {
  color: #b0b5c0;
}

.form-group__input:hover,
.form-group__select:hover {
  border-color: #c0c4cc;
  background: var(--bg-input-focus);
}

.form-group__input:focus,
.form-group__select:focus {
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-input);
}

/* ---------- Phone Input Row ---------- */
.phone-row {
  display: flex;
  gap: 10px;
}

.phone-row .form-group__select {
  width: 120px;
  flex-shrink: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23555a64' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5l-5-5h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}

.phone-row .form-group__input {
  flex: 1;
}

/* ---------- Plate Input ---------- */
.plate-input-wrapper {
  position: relative;
  background: linear-gradient(145deg, #e8ecf0, #fff);
  border: 3px solid #3a3a3a;
  border-radius: 10px;
  padding: 2px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: hidden;
}

.plate-input-wrapper .form-group__input {
  background: transparent;
  border: none;
  border-radius: 7px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 6px;
  font-size: 1.5rem;
  font-family: 'Inter', monospace;
  color: #1a1a1a;
  text-align: center;
  padding: 16px 14px;
  box-shadow: none;
}

.plate-input-wrapper .form-group__input::placeholder {
  color: #b0b0b0;
  font-weight: 500;
  letter-spacing: 4px;
  font-size: 1.1rem;
}

.plate-input-wrapper .form-group__input:hover {
  background: transparent;
  border: none;
}

.plate-input-wrapper .form-group__input:focus {
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Glow around the plate on focus */
.plate-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px var(--accent-glow),
    0 2px 8px rgba(0, 0, 0, 0.25);
}

/* ---------- Section Divider ---------- */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
}

.section-divider__line {
  flex: 1;
  height: 1px;
  background: var(--border-default);
}

.section-divider__text {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}

/* ---------- Roof Type Selector ---------- */
.roof-selector {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: fadeSlideIn 0.4s var(--transition-slow) both;
}

.roof-selector.visible {
  display: flex;
}

.roof-selector__title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.roof-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.roof-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-input);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.roof-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-glow), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.roof-card:hover {
  border-color: #b0b5c0;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.roof-card:hover::before {
  opacity: 0.3;
}

.roof-card.selected {
  border-color: var(--border-selected);
  background: rgba(26, 109, 200, 0.04);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 4px 16px rgba(26, 109, 200, 0.08);
}

.roof-card.selected::before {
  opacity: 1;
}

.roof-card__image {
  width: 80px;
  height: 60px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #f7f8fa;
  padding: 4px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.roof-card__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  z-index: 1;
}

.roof-card__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.roof-card__description {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Check indicator */
.roof-card__check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  z-index: 1;
}

.roof-card.selected .roof-card__check {
  background: var(--accent);
  border-color: var(--accent);
}

.roof-card__check svg {
  width: 12px;
  height: 12px;
  opacity: 0;
  transform: scale(0.5);
  transition: all var(--transition-fast);
}

.roof-card.selected .roof-card__check svg {
  opacity: 1;
  transform: scale(1);
}

/* ---------- Submit Button ---------- */
.btn-submit {
  background: linear-gradient(135deg, #1a6dc8, #1050a0);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 24px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
  margin-top: 4px;
}

.btn-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(26, 109, 200, 0.4);
}

.btn-submit:hover:not(:disabled)::before {
  opacity: 1;
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading state */
.btn-submit.loading {
  pointer-events: none;
  color: transparent;
}

.btn-submit.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  top: 50%;
  left: 50%;
  margin-top: -10px;
  margin-left: -10px;
}

/* ---------- Messages ---------- */
.message {
  display: none;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  align-items: center;
  gap: 10px;
  animation: fadeSlideIn 0.3s ease both;
}

.message.visible {
  display: flex;
}

.message--success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.message--error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.message__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ---------- Success Message Body ---------- */
.message__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- WhatsApp Button ---------- */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), transform var(--transition-fast);
  align-self: flex-start;
}

.btn-whatsapp:hover {
  background: #1ebe5d;
  transform: translateY(-1px);
}

.btn-whatsapp__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ---------- Animations ---------- */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ---------- Roof Image Click Hint ---------- */
.roof-card__image {
  cursor: zoom-in;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.roof-card__image:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
  z-index: 1001;
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox__img {
  max-width: min(90vw, 560px);
  max-height: 65vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: #fff;
  padding: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox.open .lightbox__img {
  transform: scale(1);
}

.lightbox__caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  max-width: 400px;
}

.lightbox__title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.lightbox__desc {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.4;
}

/* ---------- Responsive – Mobile First ---------- */
@media (max-width: 480px) {
  body {
    padding: 12px 8px;
    align-items: flex-start;
    padding-top: 24px;
  }

  .widget-container {
    max-width: 100%;
  }

  .card {
    padding: 24px 16px 20px;
    border-radius: var(--radius-lg);
  }

  .header {
    margin-bottom: 24px;
  }

  .header__logo {
    font-size: 1.5rem;
  }

  .header__subtitle {
    font-size: 0.8125rem;
  }

  .form {
    gap: 16px;
  }

  .form-group__input,
  .form-group__select {
    padding: 11px 12px;
    font-size: 1rem;
  }

  .phone-row {
    gap: 8px;
  }

  .phone-row .form-group__select {
    width: 100px;
    font-size: 0.875rem;
    padding: 11px 24px 11px 10px;
    background-position: right 8px center;
  }

  .plate-input-wrapper .form-group__input {
    font-size: 1.25rem;
    letter-spacing: 4px;
    padding: 14px 10px;
  }

  .plate-input-wrapper .form-group__input::placeholder {
    font-size: 0.95rem;
    letter-spacing: 3px;
  }

  .roof-card {
    padding: 12px;
    gap: 12px;
  }

  .roof-card__image {
    width: 64px;
    height: 48px;
  }

  .roof-card__title {
    font-size: 0.8125rem;
  }

  .roof-card__description {
    font-size: 0.6875rem;
  }

  .btn-submit {
    padding: 13px 20px;
    font-size: 0.9375rem;
  }

  .message {
    padding: 12px 14px;
    font-size: 0.8125rem;
  }
}

/* Extra small screens (320px-359px) */
@media (max-width: 359px) {
  .card {
    padding: 20px 12px 16px;
  }

  .phone-row .form-group__select {
    width: 90px;
  }

  .plate-input-wrapper .form-group__input {
    font-size: 1.1rem;
    letter-spacing: 3px;
  }

  .roof-card {
    padding: 10px;
    gap: 10px;
  }

  .roof-card__image {
    width: 56px;
    height: 42px;
  }
}
