@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --bg-deep: #0f1923;
  --bg-card: #ffffff;
  --tealca-blue: #0693e3;
  --tealca-blue-hover: #0580c8;
  --tealca-dark: #2d3940;
  --text-primary: #1a2332;
  --text-secondary: #6b7c8d;
  --text-light: #9aa8b5;
  --border-subtle: #e8edf1;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --error: #ef4444;
  --error-bg: #fef2f2;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 4px 60px rgba(0,0,0,0.12);
  --shadow-input: 0 1px 3px rgba(0,0,0,0.06);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

/* Subtle background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(6, 147, 227, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(6, 147, 227, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Layout ─── */
.registro-wrapper {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  animation: slideUp 0.5s ease-out;
}

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

/* ─── Card ─── */
.registro-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 36px 28px 32px;
  position: relative;
  overflow: hidden;
}

.registro-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--tealca-blue), #38bdf8);
}

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

.registro-logo {
  width: 120px;
  height: auto;
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeIn 0.4s ease 0.15s forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.registro-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 6px;
}

.registro-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ─── Form Fields ─── */
.field-group {
  margin-bottom: 20px;
}

.field-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.field-label .required {
  color: var(--tealca-blue);
  margin-left: 2px;
}

.field-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: #fafbfc;
  transition: all var(--transition);
  box-shadow: var(--shadow-input);
  -webkit-appearance: none;
}

.field-input::placeholder {
  color: var(--text-light);
}

.field-input:focus {
  outline: none;
  border-color: var(--tealca-blue);
  box-shadow: 0 0 0 3px rgba(6, 147, 227, 0.12);
  background: #fff;
}

.field-input:read-only {
  background: #f1f5f9;
  color: var(--text-secondary);
  cursor: not-allowed;
}

/* ─── Email row with button ─── */
.email-row {
  display: flex;
  gap: 8px;
}

.email-row .field-input {
  flex: 1;
  min-width: 0;
}

.btn-verify {
  height: 48px;
  padding: 0 16px;
  border: 1.5px solid var(--tealca-blue);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--tealca-blue);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-verify:hover {
  background: var(--tealca-blue);
  color: #fff;
}

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

/* ─── OTP Section ─── */
.otp-section {
  display: none;
  animation: expandIn 0.3s ease;
}

.otp-section.visible {
  display: block;
}

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

.otp-row {
  display: flex;
  gap: 8px;
}

.otp-input {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  font-variant-numeric: tabular-nums;
}

.btn-confirm-otp {
  height: 48px;
  padding: 0 16px;
  border: 1.5px solid var(--success);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--success);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-confirm-otp:hover {
  background: var(--success);
  color: #fff;
}

/* ─── Status messages ─── */
.status-msg {
  display: none;
  font-size: 0.8125rem;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  line-height: 1.4;
}

.status-msg.visible {
  display: block;
  animation: fadeIn 0.2s ease;
}

.status-msg.success {
  color: #065f46;
  background: var(--success-bg);
}

.status-msg.error {
  color: #991b1b;
  background: var(--error-bg);
}

.status-msg.verified {
  color: #065f46;
  background: var(--success-bg);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ─── Searchable Country Combobox ─── */
.country-combobox {
  position: relative;
}

.country-search {
  padding-right: 36px !important;
  cursor: pointer;
}

.country-chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
  transition: transform var(--transition);
}

.country-combobox.open .country-chevron {
  transform: translateY(-50%) rotate(180deg);
}

.country-listbox {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  list-style: none;
  z-index: 100;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}

.country-combobox.open .country-listbox {
  display: block;
  animation: expandIn 0.15s ease;
}

.country-option {
  padding: 10px 14px;
  font-size: 0.9375rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.1s;
}

.country-option:hover,
.country-option.highlighted {
  background: #f0f7ff;
}

.country-option.selected {
  color: var(--tealca-blue);
  font-weight: 600;
}

.country-empty {
  color: var(--text-light);
  font-style: italic;
  cursor: default;
}

.country-empty:hover {
  background: transparent;
}

.country-separator {
  height: 1px;
  margin: 4px 12px;
  background: var(--border-subtle);
}

/* Scrollbar styling for dropdown */
.country-listbox::-webkit-scrollbar {
  width: 6px;
}

.country-listbox::-webkit-scrollbar-track {
  background: transparent;
}

.country-listbox::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 3px;
}

.country-listbox::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* ─── Checkbox Section ─── */
.checkbox-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  position: relative;
  padding-left: 30px;
  min-height: 22px;
}

.checkbox-input {
  position: absolute;
  left: 0;
  top: 2px;
  width: 0;
  height: 0;
  opacity: 0;
}

.checkbox-mark {
  position: absolute;
  left: 0;
  top: 2px;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--border-subtle);
  border-radius: 5px;
  background: #fafbfc;
  transition: all var(--transition);
  flex-shrink: 0;
}

.checkbox-mark::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s ease;
}

.checkbox-input:checked ~ .checkbox-mark {
  background: var(--tealca-blue);
  border-color: var(--tealca-blue);
}

.checkbox-input:checked ~ .checkbox-mark::after {
  transform: rotate(45deg) scale(1);
}

.checkbox-input:focus-visible ~ .checkbox-mark {
  box-shadow: 0 0 0 3px rgba(6, 147, 227, 0.12);
}

.checkbox-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.checkbox-text a {
  color: var(--tealca-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  position: relative;
  z-index: 1;
}

.checkbox-text a:hover {
  color: var(--tealca-blue-hover);
}

.checkbox-text .required {
  color: var(--tealca-blue);
}

/* ─── Submit Button ─── */
.btn-submit {
  width: 100%;
  height: 52px;
  margin-top: 24px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--tealca-blue);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-submit:hover:not(:disabled) {
  background: var(--tealca-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(6, 147, 227, 0.35);
}

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

.btn-submit:disabled {
  background: var(--border-subtle);
  color: var(--text-light);
  cursor: not-allowed;
}

.submit-helper {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-top: 8px;
  line-height: 1.5;
  display: none;
}

/* ─── Validation errors ─── */
.text-danger,
.field-error {
  display: block;
  font-size: 0.75rem;
  color: var(--error);
  margin-top: 4px;
}

/* ─── Alert for server errors ─── */
.alert-error {
  background: var(--error-bg);
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.8125rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ─── Language toggle ─── */
.lang-toggle {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 16px;
}

.lang-btn {
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255,255,255,0.4);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.lang-btn:hover {
  color: rgba(255,255,255,0.7);
}

.lang-btn.active {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
}

/* ═══════════════════════════════════════════
   CONFIRMATION PAGE
   ═══════════════════════════════════════════ */

.confirm-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--success-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

.confirm-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--success);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.confirm-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.confirm-greeting {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.locker-box {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1.5px solid #bae6fd;
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 20px;
}

.locker-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.locker-code {
  font-size: 2rem;
  font-weight: 700;
  color: var(--tealca-blue);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.locker-hint {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 10px;
  line-height: 1.5;
}

.confirm-note {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
  padding: 0 4px;
}

.btn-outline-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 24px;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-outline-action:hover {
  border-color: var(--tealca-blue);
  color: var(--tealca-blue);
}

/* ─── Footer ─── */
.registro-footer {
  text-align: center;
  margin-top: 20px;
  padding: 0 20px;
}

.registro-footer p {
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.25);
  line-height: 1.5;
}

.registro-footer a {
  color: rgba(255,255,255,0.35);
  text-decoration: none;
}

.registro-footer a:hover {
  color: rgba(255,255,255,0.5);
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
  body {
    padding: 10px;
    align-items: flex-start;
    padding-top: 16px;
  }

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

  .registro-logo {
    width: 100px;
    margin-bottom: 12px;
  }

  .registro-title {
    font-size: 1.2rem;
  }

  .registro-subtitle {
    font-size: 0.8125rem;
  }

  .field-input {
    height: 44px;
    font-size: 1rem;
    padding: 0 12px;
  }

  .btn-verify,
  .btn-confirm-otp {
    height: 44px;
    padding: 0 12px;
    font-size: 0.75rem;
  }

  .email-row,
  .otp-row {
    gap: 6px;
  }

  .field-group {
    margin-bottom: 16px;
  }

  .checkbox-section {
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
  }

  .checkbox-text {
    font-size: 0.75rem;
  }

  .checkbox-row {
    padding-left: 28px;
  }

  .checkbox-mark {
    width: 18px;
    height: 18px;
  }

  .checkbox-mark::after {
    left: 5px;
    top: 1px;
    width: 5px;
    height: 9px;
  }

  .btn-submit {
    height: 48px;
    font-size: 0.9375rem;
    margin-top: 20px;
  }

  .locker-code {
    font-size: 1.75rem;
  }

  .locker-box {
    padding: 20px 16px;
  }

  /* Country dropdown: near full-width, taller on mobile */
  .country-listbox {
    max-height: 200px;
  }

  .country-option {
    padding: 12px 14px;
    font-size: 1rem;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  body {
    padding: 20px;
  }

  .registro-card {
    padding: 32px 24px 28px;
  }
}

/* ─── Remove Bootstrap overrides ─── */
.container,
.navbar,
.footer,
.border-bottom,
.border-top,
.box-shadow,
.pb-3 {
  all: unset;
}
