/* ============================================================
   VK RADIO TRADER — modal.css
   Registration & Sign In modal styles
   ============================================================ */

/* ── OVERLAY ──────────────────────────────────────────────── */
.overlay {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  padding: 1rem;
  animation: overlayIn 0.2s ease;
}
.overlay.open { display: flex; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

/* ── MODAL BOX ────────────────────────────────────────────── */
.modal {
  background: var(--white);
  border-radius: 16px;
  width: 100%; max-width: 440px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
  overflow: hidden;
  animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── MODAL HEADER ─────────────────────────────────────────── */
.modal-head {
  background: linear-gradient(135deg, #0a1628, #0d3060);
  padding: 1.5rem 1.75rem 1.25rem;
  position: relative;
}
.modal-logo {
  font-family: 'Merriweather', serif;
  font-size: 1rem; color: var(--white);
  margin-bottom: 0.85rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.modal-logo span { color: #7eb8ff; }
.modal-logo-icon {
  width: 28px; height: 28px;
  background: var(--blue); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
}
.modal-tabs { display: flex; }
.modal-tab {
  flex: 1; padding: 0.6rem 0.5rem;
  text-align: center; font-size: 0.85rem; font-weight: 500;
  cursor: pointer; color: rgba(255,255,255,0.5);
  border-bottom: 2px solid transparent;
  transition: all 0.2s; user-select: none;
}
.modal-tab:hover  { color: rgba(255,255,255,0.8); }
.modal-tab.active { color: var(--white); border-bottom-color: #7eb8ff; }
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: rgba(255,255,255,0.1); border: none;
  color: rgba(255,255,255,0.7);
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.2); color: var(--white); }

/* ── MODAL BODY ───────────────────────────────────────────── */
.modal-body { padding: 1.5rem 1.75rem 1.75rem; }

/* ── PANELS ───────────────────────────────────────────────── */
.panel { display: none; }
.panel.active { display: block; }

/* ── PROGRESS DOTS ────────────────────────────────────────── */
.progress-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 1.25rem; }
.pdot { width: 7px; height: 7px; border-radius: 50%; background: var(--grey-200); transition: all 0.3s; }
.pdot.active { background: var(--blue); transform: scale(1.2); }
.pdot.done   { background: var(--green); }

/* ── FORM ROWS ────────────────────────────────────────────── */
.form-row       { margin-bottom: 1rem; }
.form-row-split { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem; }

.field-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.78rem; font-weight: 500;
  color: var(--grey-700); margin-bottom: 0.35rem;
}
.field-hint { font-size: 0.7rem; color: var(--grey-500); font-weight: 400; }

/* ── FIELD WRAP ───────────────────────────────────────────── */
.field-wrap { position: relative; display: flex; align-items: center; }
.field-wrap input {
  width: 100%;
  padding: 0.7rem 2.5rem 0.7rem 0.9rem;
  border: 1.5px solid var(--grey-300); border-radius: 8px;
  font-family: 'Roboto', sans-serif; font-size: 0.9rem;
  color: var(--grey-900); background: var(--white); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field-wrap input::placeholder { color: var(--grey-400); }
.field-wrap input:focus  { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(13,110,253,0.12); }
.field-wrap input.valid  { border-color: var(--green); background: #f8fff8; }
.field-wrap input.invalid { border-color: var(--red); background: #fff8f8; }
.field-wrap input.valid:focus   { box-shadow: 0 0 0 3px rgba(25,135,84,0.12); }
.field-wrap input.invalid:focus { box-shadow: 0 0 0 3px rgba(220,53,69,0.12); }

.field-icon { position: absolute; right: 0.75rem; font-size: 0.9rem; pointer-events: none; }

/* Callsign prefix */
.callsign-prefix {
  position: absolute; left: 0;
  background: var(--grey-100);
  border-right: 1.5px solid var(--grey-300);
  padding: 0.7rem 0.75rem;
  font-size: 0.82rem; font-weight: 600; color: var(--grey-700);
  border-radius: 8px 0 0 8px;
  font-family: 'Roboto Mono', monospace;
  pointer-events: none; letter-spacing: 0.05em;
}
.field-wrap.has-prefix input {
  padding-left: 3rem;
  border-radius: 0 8px 8px 0;
}

/* Field message */
.field-msg {
  font-size: 0.72rem; margin-top: 0.3rem;
  min-height: 1rem; display: flex; align-items: center; gap: 0.3rem;
}
.field-msg.ok  { color: var(--green); }
.field-msg.err { color: var(--red); }
.field-msg.tip { color: var(--grey-500); }

/* ── PASSWORD STRENGTH ────────────────────────────────────── */
.pw-strength { margin-top: 0.5rem; }
.pw-bars { display: flex; gap: 3px; margin-bottom: 0.3rem; }
.pw-bar  { flex: 1; height: 3px; border-radius: 2px; background: var(--grey-200); transition: background 0.3s; }
.pw-bar.active-weak   { background: var(--red); }
.pw-bar.active-fair   { background: var(--orange); }
.pw-bar.active-good   { background: var(--gold); }
.pw-bar.active-strong { background: var(--green); }
.pw-label        { font-size: 0.7rem; color: var(--grey-500); }
.pw-label.weak   { color: var(--red); }
.pw-label.fair   { color: var(--orange); }
.pw-label.good   { color: #b08800; }
.pw-label.strong { color: var(--green); }

/* Show/hide password toggle */
.pw-toggle {
  position: absolute; right: 0.75rem;
  background: none; border: none; font-size: 0.85rem;
  cursor: pointer; color: var(--grey-500);
  padding: 0; line-height: 1; transition: color 0.2s;
}
.pw-toggle:hover { color: var(--blue); }

/* ── CALLSIGN PREVIEW ─────────────────────────────────────── */
.callsign-preview {
  display: none; align-items: center; gap: 0.5rem;
  margin-top: 0.4rem; font-size: 0.75rem;
}
.callsign-preview.show { display: flex; }
.cs-badge {
  background: var(--blue-light); color: var(--blue-dark);
  font-size: 0.7rem; font-weight: 700;
  padding: 0.15rem 0.5rem; border-radius: 3px;
  font-family: 'Roboto Mono', monospace;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.cs-label { color: var(--grey-500); }

/* ── T&C CHECKBOX ─────────────────────────────────────────── */
.tc-row {
  display: flex; gap: 0.65rem; align-items: flex-start;
  background: var(--grey-100); border: 1px solid var(--grey-300);
  border-radius: 8px; padding: 0.85rem; margin-bottom: 1rem;
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.tc-row:hover   { border-color: var(--blue); background: var(--blue-pale); }
.tc-row.checked { border-color: var(--green); background: var(--green-light); }
.tc-checkbox {
  width: 18px; height: 18px; border: 2px solid var(--grey-400);
  border-radius: 4px; flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; font-size: 0.7rem; color: transparent;
}
.tc-row.checked .tc-checkbox { background: var(--green); border-color: var(--green); color: var(--white); }
.tc-text { font-size: 0.78rem; color: var(--grey-700); line-height: 1.55; }
.tc-text a { color: var(--blue); }

/* Ham confirm */
.ham-confirm {
  display: flex; gap: 0.65rem; align-items: flex-start;
  margin-bottom: 1.25rem; cursor: pointer;
}
.ham-checkbox {
  width: 18px; height: 18px; border: 2px solid var(--grey-400);
  border-radius: 4px; flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; font-size: 0.7rem; color: transparent;
}
.ham-confirm.checked .ham-checkbox { background: var(--blue); border-color: var(--blue); color: var(--white); }
.ham-text { font-size: 0.78rem; color: var(--grey-700); line-height: 1.55; }

/* ── SUBMIT BUTTON ────────────────────────────────────────── */
.submit-btn {
  width: 100%; padding: 0.85rem;
  background: var(--blue); color: var(--white);
  border: none; border-radius: 8px;
  font-family: 'Roboto', sans-serif; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.submit-btn:hover:not(:disabled) { background: var(--blue-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(13,110,253,0.35); }
.submit-btn:disabled  { background: var(--grey-400); cursor: not-allowed; transform: none; box-shadow: none; }
.submit-btn.loading   { pointer-events: none; }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--white); border-radius: 50%;
  animation: spin 0.7s linear infinite; display: none;
}
.submit-btn.loading .spinner   { display: block; }
.submit-btn.loading .btn-text  { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SIGN IN PANEL ────────────────────────────────────────── */
.signin-intro { font-size: 0.83rem; color: var(--grey-500); margin-bottom: 1.25rem; font-weight: 300; line-height: 1.5; }
.forgot-link  { font-size: 0.75rem; color: var(--blue); text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }
.switch-link  { text-align: center; font-size: 0.8rem; color: var(--grey-500); margin-top: 1rem; }
.switch-link a { color: var(--blue); font-weight: 500; }

/* ── SUCCESS PANEL ────────────────────────────────────────── */
.success-panel { text-align: center; padding: 1rem 0; }
.success-icon {
  width: 64px; height: 64px; background: var(--green-light);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; margin: 0 auto 1.25rem;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success-panel h3 { font-family: 'Merriweather', serif; font-size: 1.2rem; color: var(--grey-900); margin-bottom: 0.5rem; }
.success-panel p  { font-size: 0.85rem; color: var(--grey-500); line-height: 1.65; margin-bottom: 1.25rem; font-weight: 300; }
.success-steps    { background: var(--grey-100); border-radius: 8px; padding: 1rem; text-align: left; margin-bottom: 1.25rem; }
.success-step     { display: flex; align-items: center; gap: 0.75rem; padding: 0.45rem 0; border-bottom: 1px solid var(--grey-200); font-size: 0.8rem; color: var(--grey-700); }
.success-step:last-child { border-bottom: none; }
.step-icon    { font-size: 1rem; flex-shrink: 0; }
.step-done    { color: var(--green); font-size: 0.75rem; margin-left: auto; font-weight: 500; }
.step-pending { color: var(--grey-400); font-size: 0.75rem; margin-left: auto; }
.go-btn {
  width: 100%; padding: 0.8rem;
  background: var(--green); color: var(--white);
  border: none; border-radius: 8px;
  font-family: 'Roboto', sans-serif; font-size: 0.92rem; font-weight: 600;
  cursor: pointer; transition: background 0.2s, transform 0.15s;
}
.go-btn:hover { background: #157347; transform: translateY(-1px); }

/* ── MOBILE ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  .modal           { border-radius: 12px; }
  .modal-body      { padding: 1.25rem; }
  .form-row-split  { grid-template-columns: 1fr; }
}
