/*
 * DOTMCS USDOT Form — WordPress Plugin Styles
 * All classes prefixed with 'dotmcs-' to avoid theme collisions.
 */

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

/* ── Wrapper ───────────────────────────────────────────────────────────────── */
.dotmcs-form-wrapper {
  max-width: 1050px;
  margin: 40px auto 80px;
  padding: 0 20px;
  font-family: 'Roboto', sans-serif;
  color: #1a2633;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.dotmcs-form-wrapper *, .dotmcs-form-wrapper *::before, .dotmcs-form-wrapper *::after {
  box-sizing: border-box;
}

/* ── Card ──────────────────────────────────────────────────────────────────── */
.dotmcs-form-card {
  background: #ffffff;
  border: 1px solid #d0dcea;
  border-radius: 8px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.05);
  overflow: hidden;
}

/* ── Progress Header ──────────────────────────────────────────────────────── */
.dotmcs-progress-header {
  background: #f5f7fa;
  border-bottom: 1px solid #d0dcea;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dotmcs-step-label {
  font-size: .85rem;
  font-weight: 500;
  color: #003366;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.dotmcs-step-title {
  font-size: .82rem;
  font-weight: 600;
  color: #1976d2;
  white-space: nowrap;
}

.dotmcs-progress-bar-container {
  flex: 1;
  margin: 0 24px;
  height: 6px;
  background: #d0dcea;
  border-radius: 3px;
  overflow: hidden;
}

.dotmcs-progress-bar-fill {
  height: 100%;
  background: #1976d2;
  border-radius: 3px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}

/* ── Steps ─────────────────────────────────────────────────────────────────── */
.dotmcs-step {
  padding: 36px 44px;
  min-height: 250px;
  display: none;
}

.dotmcs-step.active {
  display: block;
  animation: dotmcsFadeIn .4s ease-in-out;
}

@keyframes dotmcsFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dotmcs-step-heading {
  font-size: 1.3rem;
  font-weight: 500;
  color: #003366;
  letter-spacing: .04em;
  margin-bottom: 6px;
}

.dotmcs-step-subtext {
  font-size: .9rem;
  color: #5a6e82;
  line-height: 1.5;
  margin-bottom: 28px;
}

/* ── Form Groups ──────────────────────────────────────────────────────────── */
.dotmcs-fg {
  margin-bottom: 24px;
  position: relative;
}

.dotmcs-label {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  color: #1a2633;
  margin-bottom: 8px;
}

.dotmcs-req {
  color: #c0392b;
  margin-left: 3px;
}

.dotmcs-fg input[type="text"],
.dotmcs-fg input[type="email"],
.dotmcs-fg input[type="tel"],
.dotmcs-fg input[type="number"],
.dotmcs-fg select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #d0dcea;
  border-radius: 5px;
  font-family: 'Roboto', sans-serif;
  font-size: .92rem;
  color: #1a2633;
  background: #ffffff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.dotmcs-fg input:focus,
.dotmcs-fg select:focus {
  border-color: #1976d2;
  box-shadow: 0 0 0 3px rgba(25,118,210,.12);
}

.dotmcs-fg input.dotmcs-error-input,
.dotmcs-fg select.dotmcs-error-input {
  border-color: #c0392b;
  background-color: #fdf2f2;
}

.dotmcs-error {
  color: #c0392b;
  font-size: .8rem;
  font-weight: 500;
  margin-top: 5px;
  display: none;
  align-items: center;
  gap: 4px;
  animation: dotmcsShake .3s ease;
}

@keyframes dotmcsShake {
  0%,100% { transform: translateX(0); }
  25%     { transform: translateX(-4px); }
  75%     { transform: translateX(4px); }
}

.dotmcs-helper {
  font-size: .75rem;
  color: #5a6e82;
  margin-top: 5px;
  line-height: 1.4;
}

.dotmcs-phone-row {
  display: flex;
  gap: 10px;
}

.dotmcs-phone-select {
  width: 130px !important;
  flex-shrink: 0;
}

/* ── Toggle Buttons ────────────────────────────────────────────────────────── */
.dotmcs-toggle {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border: 1.5px solid #d0dcea;
  border-radius: 5px;
  background: #ffffff;
  cursor: pointer;
  font-size: .92rem;
  font-weight: 500;
  color: #1a2633;
  transition: all .2s;
  margin-bottom: 8px;
}

.dotmcs-toggle:hover {
  background-color: #f5f7fa;
  border-color: #b0c4de;
}

.dotmcs-toggle.checked {
  background-color: #e8f1fb;
  border-color: #1976d2;
  color: #1256a0;
}

.dotmcs-toggle input[type="radio"],
.dotmcs-toggle input[type="checkbox"] {
  display: none;
}

/* Radio dot indicator */
.dotmcs-toggle-dot {
  width: 18px;
  height: 18px;
  border: 2px solid #d0dcea;
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
  position: relative;
  transition: all .2s;
}

.dotmcs-toggle.checked .dotmcs-toggle-dot {
  border-color: #1976d2;
}

.dotmcs-toggle.checked .dotmcs-toggle-dot::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: #1976d2;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
}

/* Checkbox check indicator */
.dotmcs-toggle-check {
  width: 18px;
  height: 18px;
  border: 2px solid #d0dcea;
  border-radius: 3px;
  margin-right: 12px;
  flex-shrink: 0;
  position: relative;
  transition: all .2s;
}

.dotmcs-toggle.checked .dotmcs-toggle-check {
  border-color: #1976d2;
}

.dotmcs-toggle.checked .dotmcs-toggle-check::after {
  content: "✓";
  position: absolute;
  color: #1976d2;
  font-size: 12px;
  font-weight: bold;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
}

/* ── Grids ─────────────────────────────────────────────────────────────────── */
.dotmcs-grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px,1fr));
  gap: 20px;
}

.dotmcs-grid3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
  gap: 16px;
}

.dotmcs-divider {
  height: 1px;
  background: #d0dcea;
  margin: 24px 0;
}

/* ── Country Buttons ──────────────────────────────────────────────────────── */
.dotmcs-country-btn {
  padding: 10px 24px;
  border: 1.5px solid #d0dcea;
  border-radius: 5px;
  background: #ffffff;
  color: #1a2633;
  cursor: pointer;
  font-weight: 600;
  font-size: .92rem;
  transition: all .2s;
  font-family: 'Roboto', sans-serif;
}

.dotmcs-country-btn.selected {
  border-color: #1976d2;
  background: #e8f1fb;
  color: #1976d2;
}

/* ── Vehicle Cards ────────────────────────────────────────────────────────── */
.dotmcs-vehicle-card {
  border: 1.5px solid #d0dcea;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
  background: #ffffff;
}

.dotmcs-vc-title {
  font-weight: 600;
  font-size: .95rem;
  color: #003366;
  margin-bottom: 12px;
  border-bottom: 1px solid #f5f7fa;
  padding-bottom: 6px;
}

.dotmcs-vc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px,1fr));
  gap: 12px;
}

.dotmcs-vc-box label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: #5a6e82;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.dotmcs-vc-box input[type="number"] {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #d0dcea;
  border-radius: 5px;
  font-family: 'Roboto', sans-serif;
  font-size: .92rem;
  color: #1a2633;
  outline: none;
  transition: border-color .2s;
}

.dotmcs-vc-box input[type="number"]:focus {
  border-color: #1976d2;
  box-shadow: 0 0 0 3px rgba(25,118,210,.12);
}

/* ── Hazmat Table ─────────────────────────────────────────────────────────── */
.dotmcs-hazmat-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  margin-bottom: 24px;
}

.dotmcs-hazmat-table th {
  background: #f5f7fa;
  border: 1px solid #d0dcea;
  padding: 10px 12px;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #003366;
  text-align: center;
}

.dotmcs-hazmat-table td {
  border: 1px solid #d0dcea;
  padding: 10px 12px;
  font-size: .88rem;
  vertical-align: middle;
}

.dotmcs-hm-name { font-weight: 600; color: #1a2633; }
.dotmcs-hm-desc { font-size: .76rem; color: #5a6e82; margin-top: 2px; }
.dotmcs-hm-cell { text-align: center; }
.dotmcs-hm-cell input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: #1976d2; }

/* ── Checkout ─────────────────────────────────────────────────────────────── */
.dotmcs-checkout-box {
  background: #f5f7fa;
  border: 1.5px solid #d0dcea;
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 28px;
}

.dotmcs-checkout-title {
  font-size: .95rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #003366;
  letter-spacing: .08em;
  margin-bottom: 16px;
  border-bottom: 1px solid #d0dcea;
  padding-bottom: 8px;
}

.dotmcs-checkout-row {
  display: flex;
  justify-content: space-between;
  font-size: .9rem;
  margin-bottom: 10px;
  color: #1a2633;
}

.dotmcs-checkout-total {
  font-size: 1.15rem;
  font-weight: 700;
  border-top: 1px dashed #d0dcea;
  padding-top: 12px;
  margin-top: 14px;
  color: #003366;
}

/* ── Signature ────────────────────────────────────────────────────────────── */
.dotmcs-sig-container {
  position: relative;
  border: 1.5px solid #d0dcea;
  border-radius: 6px;
  background: #ffffff;
  height: 150px;
  margin-bottom: 24px;
  overflow: hidden;
}

.dotmcs-sig-canvas {
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.dotmcs-sig-clear {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: .75rem;
  color: #5a6e82;
  cursor: pointer;
  text-decoration: underline;
  font-family: 'Roboto', sans-serif;
}

/* ── Navigation ──────────────────────────────────────────────────────────── */
.dotmcs-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 44px 28px;
  border-top: 1px solid #d0dcea;
  background: #ffffff;
}

.dotmcs-btn-prev {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: #5a6e82;
  font-family: 'Roboto', sans-serif;
  font-size: .88rem;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 5px;
  border: 1.5px solid #d0dcea;
  cursor: pointer;
  transition: all .15s;
}

.dotmcs-btn-prev:hover {
  background-color: #f5f7fa;
  color: #1a2633;
  border-color: #b0c4de;
}

.dotmcs-btn-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1976d2;
  color: #ffffff;
  border: none;
  padding: 11px 28px;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  font-size: .88rem;
  font-weight: 600;
  transition: background .15s, transform .1s;
}

.dotmcs-btn-next:hover { background: #1256a0; }
.dotmcs-btn-next:active { transform: scale(.98); }
.dotmcs-btn-next:disabled { opacity: .6; cursor: not-allowed; }

.dotmcs-btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  color: #003366;
  border: 1.5px solid #003366;
  padding: 10px 18px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  transition: all .15s;
}

.dotmcs-btn-admin:hover { background: #e8f1fb; }

/* ── Modals ───────────────────────────────────────────────────────────────── */
.dotmcs-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  backdrop-filter: blur(2px);
}

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

.dotmcs-modal-box {
  background: white;
  border-radius: 12px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  overflow: hidden;
  animation: dotmcsModalScale .3s cubic-bezier(.34,1.56,.64,1);
}

@keyframes dotmcsModalScale {
  from { transform: scale(.9); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

.dotmcs-modal-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  font-weight: bold;
}

.dotmcs-modal-info    { background: #1976d2; }
.dotmcs-modal-warning { background: #d97706; }
.dotmcs-modal-danger  { background: #c0392b; }

.dotmcs-modal-body {
  padding: 24px;
}

.dotmcs-modal-body p {
  font-size: .93rem;
  color: #1a2633;
  line-height: 1.6;
  margin-bottom: 24px;
}

.dotmcs-modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.dotmcs-modal-btn {
  padding: 10px 22px;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  transition: all .2s;
}

.dotmcs-modal-btn-primary {
  background: #003366;
  color: white;
  border: none;
}
.dotmcs-modal-btn-primary:hover { background: #002244; }

.dotmcs-modal-btn-secondary {
  background: white;
  color: #374151;
  border: 2px solid #d0dcea;
}
.dotmcs-modal-btn-secondary:hover { background: #f5f7fa; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .dotmcs-step       { padding: 24px 20px; }
  .dotmcs-nav-row    { padding: 16px 20px; }
  .dotmcs-progress-header { padding: 12px 20px; }
}
