/* ── VARIABLES ───────────────────────────── */
:root {
  --primary: #021d33;
  --primary-mid: #0a2d4d;
  --accent: #0f6e9e;
  --bg: #f0f4f8;
  --card: #ffffff;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #475569;
  --success: #16a34a;
  --danger: #dc2626;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-lg: 0 12px 40px rgba(2,29,51,.13), 0 4px 12px rgba(2,29,51,.07);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── TOP BAR ─────────────────────────────── */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  padding: 16px 24px;
  z-index: 50;
}

.volver-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.volver-btn svg { width: 15px; height: 15px; }
.volver-btn:hover { background: #fff; color: var(--text); box-shadow: 0 4px 12px rgba(0,0,0,.12); }

/* ── SPLIT LAYOUT ────────────────────────── */
.register-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ── BRAND PANEL ─────────────────────────── */
.brand-panel {
  background: linear-gradient(145deg, var(--primary) 0%, #0a3a5c 60%, #0f5c8a 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 56px;
  position: relative;
  overflow: hidden;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand-content { position: relative; z-index: 2; }

.brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.2);
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

.brand-title {
  margin: 0 0 12px;
  font-size: 36px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -.02em;
}

.brand-sub {
  margin: 0 0 36px;
  font-size: 15px;
  color: rgba(255,255,255,.6);
  line-height: 1.6;
  max-width: 320px;
}

.brand-features { display: flex; flex-direction: column; gap: 12px; }

.feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: rgba(255,255,255,.8);
  font-weight: 500;
}

.feature-item svg { width: 16px; height: 16px; stroke: #38bdf8; flex-shrink: 0; }

.brand-circles { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.circle { position: absolute; border-radius: 50%; background: rgba(255,255,255,.04); }
.c1 { width: 360px; height: 360px; right: -120px; top: -100px; }
.c2 { width: 220px; height: 220px; right: 40px; bottom: -60px; background: rgba(255,255,255,.03); }
.c3 { width: 100px; height: 100px; left: 40px; bottom: 120px; background: rgba(255,255,255,.05); }

/* ── FORM PANEL ──────────────────────────── */
.form-panel {
  display: flex;
  justify-content: center;
  padding: 64px 40px 48px;
  overflow-y: auto;
}

/* ── REGISTER CARD ───────────────────────── */
.register-card {
  background: var(--card);
  width: 100%;
  max-width: 440px;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: fadeUp .4s ease;
  align-self: flex-start;
  margin-top: 8px;
}

.card-header {
  padding: 26px 32px 18px;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
}

.card-header p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}

form {
  padding: 22px 32px 28px;
}

/* ── FIELDS GRID ─────────────────────────── */
.fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.field-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.field-group.full { grid-column: 1 / -1; }

label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 5px;
  display: block;
}

input {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

input::placeholder { color: #b0bac7; }

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15,110,158,.12);
}

input.valid   { border-color: var(--success); }
input.invalid { border-color: var(--danger); }

/* ── PASSWORD ────────────────────────────── */
.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 44px; }

.toggle-pass {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  transition: color .2s;
}

.toggle-pass svg { width: 16px; height: 16px; display: block; }
.toggle-pass:hover { color: var(--primary); }

/* ── STRENGTH BAR ────────────────────────── */
.strength-bar {
  height: 5px;
  border-radius: 10px;
  background: var(--border);
  overflow: hidden;
  margin-top: 8px;
}

#strengthBar {
  height: 100%;
  width: 0;
  transition: width .3s, background .3s;
  border-radius: 10px;
}

/* ── RULES ───────────────────────────────── */
.rules {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}

.rules li {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: #94a3b8;
  font-weight: 500;
  transition: color .2s;
}

.rules li svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  stroke: #94a3b8;
  transition: stroke .2s;
}

.rules li.valid       { color: var(--success); }
.rules li.valid svg   { stroke: var(--success); }
.rules li.invalid     { color: var(--danger); }
.rules li.invalid svg { stroke: var(--danger); }

/* ── SUBMIT ──────────────────────────────── */
.btn-submit {
  width: 100%;
  margin-top: 18px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .2s;
}

.btn-submit:hover {
  background: #0a2d4d;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(2,29,51,.3);
}

/* ── ERROR MSG ───────────────────────────── */
.error-msg {
  color: var(--danger);
  font-size: 12.5px;
  text-align: center;
  min-height: 16px;
  margin-top: 8px;
  font-weight: 500;
}

/* ── DIVIDER ─────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 12px;
  padding: 11px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all .2s;
}

.btn-login:hover { background: var(--bg); border-color: #94a3b8; }

/* ── ANIMATION ───────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── RESPONSIVE ──────────────────────────── */
@media (max-width: 768px) {
  .register-layout { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .form-panel { padding: 72px 16px 40px; }
  .register-card { max-width: 100%; }
  .fields-grid { grid-template-columns: 1fr; }
  .rules { grid-template-columns: 1fr; }
}