/* ============================================
   WEBVIEW REGISTER – styles (Consistent with Login)
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand: #ff9800;
  --brand-dark: #ef8c00;
  --brand-soft: #fff3e2;
  --surface: #ffffff;
  --surface-light: #f9f7f4;
  --text: #141821;
  --text-muted: #6f7684;
  --line: #e7e8ee;
  --error: #cf3d3d;
  --ok: #2f9860;
  --radius: 14px;
  --radius-sm: 10px;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  min-height: 100dvh;
  background:
    radial-gradient(circle at 20% -10%, #f8d9a5 0%, transparent 45%),
    radial-gradient(circle at 90% 0%, #f9e8c8 0%, transparent 38%),
    linear-gradient(180deg, #f8efe0 0%, #f8f8f8 62%);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* ---- PAGE CONTAINER ---- */
.wvr-page {
  width: min(100%, 480px);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 0 32px;
}

/* ---- TOAST ---- */
.wvr-toast {
  position: fixed;
  top: max(env(safe-area-inset-top), 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: #1a2a59;
  color: #fff;
  padding: 12px 22px;
  border-radius: 50px;
  font-size: 13.5px;
  font-weight: 500;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 6px 24px rgba(0,0,0,0.40);
  transition: transform 0.3s ease;
  pointer-events: none;
}
.wvr-toast.show { transform: translateX(-50%) translateY(0); }
.wvr-toast.error { background: #7f1d1d; }
.wvr-toast.success { background: #14532d; }

/* ---- HEADER ---- */
.wvr-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 12px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: transparent;
}

.wvr-back {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  cursor: pointer;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
  transition: background 0.15s;
  box-shadow: 0 2px 8px rgba(31, 35, 44, 0.08);
}
.wvr-back:hover { background: var(--brand-soft); }

.wvr-progress {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: #e7e8ee;
  overflow: hidden;
}
.wvr-progress-bar {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #ffad21 0%, var(--brand) 100%);
  transition: width 0.4s ease;
  width: 25%;
}

.wvr-step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- STEP PANELS ---- */
.wvr-step {
  display: none;
  flex-direction: column;
  flex: 1;
  padding: 8px 22px 24px;
  animation: slideIn 0.3s ease;
  background: var(--surface);
  border-radius: 14px;
  margin: 12px;
  box-shadow: 0 8px 22px rgba(34, 39, 48, 0.06);
}
.wvr-step.active { display: flex; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(22px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---- STEP TITLE ---- */
.wvr-step-title {
  margin-bottom: 24px;
}
.wvr-step-title i {
  font-size: 28px;
  color: var(--brand);
  display: block;
  margin-bottom: 8px;
}
.wvr-step-title h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
}
.wvr-step-title p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ---- FORM & FIELDS ---- */
.wvr-form { display: flex; flex-direction: column; gap: 18px; flex: 1; }

.wvr-field { display: flex; flex-direction: column; gap: 7px; }

.wvr-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.req { color: var(--error); }
.wvr-opt { font-weight: 400; color: var(--text-muted); font-size: 12px; }
.wvr-hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---- INPUT WRAP ---- */
.wvr-input-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(6px);
  transition: border 0.15s;
}
.wvr-input-wrap:focus-within { border-color: var(--brand); }

.wvr-input-wrap i {
  padding: 13px 12px 0 14px;
  font-size: 17px;
  color: var(--text-muted);
  flex-shrink: 0;
  line-height: 1;
}

.wvr-input-wrap input,
.wvr-input-wrap textarea {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px 12px 0;
  outline: none;
  resize: none;
  min-width: 0;
}
.wvr-input-wrap input::placeholder,
.wvr-input-wrap textarea::placeholder { color: #bbbcc4; }

/* ---- SELECT WRAP ---- */
.wvr-select-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(6px);
  transition: border 0.15s;
}
.wvr-select-wrap:focus-within { border-color: var(--brand); }
.wvr-select-wrap i {
  padding: 0 12px 0 14px;
  font-size: 17px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.wvr-select-wrap select {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 13px 14px 13px 0;
  outline: none;
  appearance: none;
  cursor: pointer;
  min-width: 0;
}
.wvr-select-wrap select option { background: var(--surface); color: var(--text); }

/* ---- MAP ---- */
.wvr-map-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.5px solid var(--line);
}
#wvrMap {
  height: 220px;
  width: 100%;
  background: var(--surface-light);
}

.wvr-loc-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 800;
  background: var(--surface);
  color: var(--brand);
  border: 1.5px solid var(--line);
  border-radius: 50px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(31, 35, 44, 0.08);
}
.wvr-loc-btn:hover { background: var(--brand-soft); border-color: var(--brand); }

.wvr-layer-toggle {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 800;
  background: var(--surface);
  color: var(--brand);
  border: 1.5px solid var(--line);
  border-radius: 50px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(8px);
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(31, 35, 44, 0.08);
}
.wvr-layer-toggle:hover { background: var(--brand-soft); border-color: var(--brand); }

/* ODP info row */
.wvr-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  color: var(--text);
}
.wvr-info-row i { font-size: 20px; flex-shrink: 0; }
.wvr-info-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.wvr-info-val { font-size: 13.5px; font-weight: 600; color: var(--ok); margin-top: 2px; }

/* ---- PACKAGE TABS ---- */
.pkg-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.pkg-tabs::-webkit-scrollbar { display: none; }

.pkg-tab {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 50px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  backdrop-filter: blur(6px);
}
.pkg-tab.active {
  background: linear-gradient(180deg, #ffad21 0%, var(--brand) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 12px rgba(255, 152, 0, 0.3);
}

/* ---- PACKAGE GRID ---- */
.pkg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pkg-loading {
  grid-column: 1/-1;
  text-align: center;
  padding: 28px;
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

@keyframes pkgSpin { to { transform: rotate(360deg); } }
.pkg-spin { display: inline-block; animation: pkgSpin 0.8s linear infinite; }

/* ---- PACKAGE CARD ---- */
.pkg-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 14px 12px 12px;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  backdrop-filter: blur(6px);
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 6px rgba(31, 35, 44, 0.08);
}
.pkg-card:active { transform: scale(0.97); }
.pkg-card.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.25);
}

.pkg-card-check {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 16px;
  color: var(--brand);
  opacity: 0;
  transition: opacity 0.15s;
}
.pkg-card.selected .pkg-card-check { opacity: 1; }

.pkg-card-speed {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-bottom: 2px;
}
.pkg-card-speed-num {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}
.pkg-card-speed-unit {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.8;
  margin-bottom: 1px;
  color: var(--text-muted);
}

.pkg-card-tier {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 50px;
  width: fit-content;
  margin-bottom: 2px;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.pkg-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.pkg-card-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}
.pkg-card-price span {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.pkg-card-install {
  font-size: 11px;
  color: var(--text-muted);
}

/* ---- SELECTED BAR ---- */
.pkg-selected-bar {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 6px rgba(31, 35, 44, 0.08);
}
.pkg-selected-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pkg-selected-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.pkg-selected-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- UPLOAD ZONE ---- */
.wvr-upload-zone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-light);
  backdrop-filter: blur(6px);
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  box-shadow: 0 2px 6px rgba(31, 35, 44, 0.06);
}
.wvr-upload-zone:hover,
.wvr-upload-zone:active { border-color: var(--brand); background: var(--brand-soft); }

.wvr-upload-zone-sm { padding: 16px; }

.wvr-upload-placeholder i {
  font-size: 30px;
  color: var(--brand);
  display: block;
  margin-bottom: 8px;
}
.wvr-upload-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.wvr-upload-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* Upload preview inside zone */
.wvr-file-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.wvr-file-preview img {
  max-height: 180px;
  max-width: 100%;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  object-fit: contain;
}
.wvr-file-preview .wvr-file-name {
  font-size: 12.5px;
  color: var(--text);
  word-break: break-all;
  text-align: center;
}
.wvr-file-preview .wvr-file-size {
  font-size: 11.5px;
  color: var(--text-muted);
}
.wvr-file-change {
  font-size: 12px;
  color: var(--brand);
  text-decoration: underline;
  margin-top: 2px;
  cursor: pointer;
}

/* PDF preview */
.wvr-pdf-preview {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.wvr-pdf-preview i { font-size: 40px; color: var(--error); }
.wvr-pdf-preview .wvr-file-name { font-size: 12.5px; color: var(--text); word-break: break-all; text-align: center; }
.wvr-pdf-preview .wvr-file-size { font-size: 11.5px; color: var(--text-muted); }
.wvr-pdf-preview .wvr-file-change { font-size: 12px; color: var(--brand); text-decoration: underline; cursor: pointer; }

/* ---- ACTIONS (bottom button area) ---- */
.wvr-actions {
  margin-top: 28px;
}

.wvr-btn-primary {
  width: 100%;
  padding: 15px 24px;
  border-radius: 50px;
  border: none;
  background: linear-gradient(180deg, #ffad21 0%, var(--brand) 100%);
  color: #fff;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 4px 18px rgba(255, 152, 0, 0.3);
  transition: opacity 0.15s, transform 0.1s;
}
.wvr-btn-primary:active { opacity: 0.85; transform: scale(0.98); }
.wvr-btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.wvr-btn-submit {
  background: linear-gradient(135deg, var(--ok), var(--ok));
  box-shadow: 0 4px 18px rgba(47, 152, 96, 0.3);
}

/* ---- SUCCESS SCREEN ---- */
.wvr-success-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex: 1;
  text-align: center;
  padding: 20px 0;
}
.wvr-success-icon {
  font-size: 72px;
  color: var(--ok);
  line-height: 1;
  margin-bottom: 4px;
}
.wvr-success-wrap h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}
.wvr-success-wrap p {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.65;
}
.wvr-reg-code {
  background: var(--brand-soft);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px 28px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--brand-dark);
  font-variant-numeric: tabular-nums;
}
.wvr-reg-note {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: -8px;
}

/* ---- FOOTER ---- */
.wvr-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 20px 8px;
  margin-top: auto;
}

.wvr-footer-sep {
  opacity: .45;
}

.wvr-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.wvr-footer a:hover,
.wvr-footer a:focus-visible {
  color: var(--brand-dark);
  text-decoration: underline;
}

/* Loader spinner inside button */
@keyframes spin { to { transform: rotate(360deg); } }
.wvr-spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255, 152, 0, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}
