/* ─── TUMOVIE.CL — Auth Pages Styles ─── */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --black:    #080808;
  --s1:       #111111;
  --s2:       #161616;
  --s3:       #1c1c1c;
  --b1:       #1f1f1f;
  --b2:       #2a2a2a;
  --b3:       #383838;
  --orange:   #FF6500;
  --od:       #cc5000;
  --og:       rgba(255,101,0,0.10);
  --amber:    #FFB800;
  --green:    #22c55e;
  --red:      #ef4444;
  --white:    #F5F5F0;
  --m1:       #888880;
  --m2:       #555550;
  --display:  'Bebas Neue', sans-serif;
  --body:     'DM Sans', sans-serif;
  --mono:     'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── Grain overlay ── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.022;
  pointer-events: none;
  z-index: 999;
}

/* ── Líneas de fondo ── */
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 79px, rgba(255,101,0,0.03) 80px),
    repeating-linear-gradient(90deg, transparent, transparent 79px, rgba(255,101,0,0.03) 80px);
  pointer-events: none;
  z-index: 1;
}

/* ── Nav mínimo ── */
.auth-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 56px;
  border-bottom: 1px solid var(--b1);
  position: relative;
  z-index: 10;
}

.nav-logo {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: .04em;
  text-decoration: none;
  color: var(--white);
}
.nav-logo span { color: var(--orange); }

.nav-back {
  font-size: 12px;
  color: var(--m1);
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: color .2s;
}
.nav-back:hover { color: var(--white); }

/* ── Layout principal ── */
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  z-index: 2;
}

/* ── Glow naranja de fondo ── */
.auth-glow {
  position: fixed;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,101,0,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* ── Card contenedor ── */
.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: 12px;
  padding: 40px;
  position: relative;
  animation: cardIn .4s ease both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.auth-card-wide {
  max-width: 560px;
}

/* ── Header card ── */
.auth-header {
  margin-bottom: 32px;
  text-align: center;
}

.auth-title {
  font-family: var(--display);
  font-size: 36px;
  letter-spacing: .04em;
  line-height: 1;
  margin-bottom: 10px;
}
.auth-title span { color: var(--orange); }

.auth-subtitle {
  font-size: 14px;
  color: var(--m1);
  line-height: 1.5;
}

/* ── Selector de rol (registro) ── */
.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

.role-option {
  border: 1px solid var(--b2);
  border-radius: 8px;
  padding: 20px 16px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.role-option:hover {
  border-color: var(--b3);
  background: var(--s2);
}

.role-option.selected {
  border-color: var(--orange);
  background: var(--og);
}

.role-option.selected::after {
  content: '✓';
  position: absolute;
  top: 10px; right: 12px;
  font-size: 12px;
  color: var(--orange);
}

.role-icon {
  font-size: 28px;
  margin-bottom: 10px;
  display: block;
}

.role-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.role-desc {
  font-size: 11px;
  color: var(--m1);
  line-height: 1.4;
}

/* ── Plan selector (registro creador/negocio) ── */
.plan-selector {
  margin-bottom: 24px;
}

.plan-label-title {
  font-size: 12px;
  color: var(--m1);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.plan-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--b2);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.plan-option:hover { background: var(--s2); }
.plan-option.selected { border-color: var(--orange); background: var(--og); }

.plan-option input[type="radio"] {
  display: none;
}

.plan-info { flex: 1; }
.plan-name { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.plan-features {
  font-size: 11px;
  color: var(--m1);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.plan-features span::before { content: '· '; }

.plan-price {
  text-align: right;
  flex-shrink: 0;
  margin-left: 12px;
}
.plan-amount {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--white);
}
.plan-period {
  font-size: 10px;
  color: var(--m2);
}

.plan-badge-free {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(34,197,94,.15);
  color: var(--green);
  border: 1px solid rgba(34,197,94,.25);
}

/* ── Formulario ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  font-size: 12px;
  color: var(--m1);
  letter-spacing: .04em;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: 6px;
  padding: 12px 14px;
  color: var(--white);
  font-family: var(--body);
  font-size: 14px;
  transition: border-color .2s, background .2s;
  outline: none;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

input:focus, select:focus {
  border-color: var(--orange);
  background: var(--s3);
}

input::placeholder { color: var(--m2); }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888880' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

select option {
  background: var(--s2);
  color: var(--white);
}

/* Input con icono de toggle password */
.input-wrap {
  position: relative;
}
.input-wrap input { padding-right: 44px; }
.toggle-pass {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--m1);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  transition: color .2s;
}
.toggle-pass:hover { color: var(--white); }

/* ── Divider ── */
.form-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
}
.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--b2);
}
.form-divider span {
  font-size: 11px;
  color: var(--m2);
}

/* ── Botones ── */
.btn-auth {
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 14px 24px;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, transform .1s, opacity .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}
.btn-auth:hover  { background: var(--od); transform: translateY(-1px); }
.btn-auth:active { transform: translateY(0); }
.btn-auth:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-auth-outline {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--b3);
  border-radius: 6px;
  padding: 13px 24px;
  font-family: var(--body);
  font-size: 14px;
  cursor: pointer;
  transition: border-color .2s, transform .1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  text-decoration: none;
}
.btn-auth-outline:hover { border-color: var(--m1); transform: translateY(-1px); }

/* ── Spinner en botón ── */
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.loading .btn-spinner { display: block; }
.loading .btn-text    { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error / success messages ── */
.auth-message {
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 13px;
  display: none;
  align-items: flex-start;
  gap: 10px;
}
.auth-message.show { display: flex; }
.auth-message.error {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.25);
  color: #fca5a5;
}
.auth-message.success {
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.25);
  color: #86efac;
}
.auth-message.info {
  background: rgba(59,130,246,.1);
  border: 1px solid rgba(59,130,246,.25);
  color: #93c5fd;
}

.msg-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.msg-text { line-height: 1.5; }

/* ── Footer del card ── */
.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--m1);
}
.auth-footer a {
  color: var(--orange);
  text-decoration: none;
  transition: color .2s;
}
.auth-footer a:hover { color: var(--white); }

/* ── Términos ── */
.terms-note {
  font-size: 11px;
  color: var(--m2);
  text-align: center;
  line-height: 1.5;
  margin-top: 4px;
}
.terms-note a { color: var(--m1); text-decoration: underline; }

/* ── Separador vertical de plans ── */
.plan-commission-note {
  font-size: 11px;
  color: var(--m2);
  text-align: center;
  margin-top: 6px;
}

/* ── Responsive ── */
@media (max-width: 540px) {
  .auth-card { padding: 28px 20px; }
  .role-selector { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .auth-nav { padding: 0 20px; }
}

/* ── Nav con usuario (se usa en todas las páginas) ── */
.btn-nav-outline {
  font-size: 13px;
  padding: 8px 16px;
  border: 1px solid var(--b3);
  border-radius: 4px;
  color: var(--white);
  text-decoration: none;
  transition: border-color .2s;
}
.btn-nav-outline:hover { border-color: var(--m1); }

.btn-nav-fill {
  font-size: 13px;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  background: var(--orange);
  color: var(--white);
  text-decoration: none;
  cursor: pointer;
  font-family: var(--body);
  transition: background .2s;
}
.btn-nav-fill:hover { background: var(--od); }

/* Nav user menu dropdown */
.nav-right { display: flex; align-items: center; gap: 8px; }

.nav-user-menu { position: relative; }
.nav-avatar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background .2s;
}
.nav-avatar-btn:hover { background: var(--s2); }
.nav-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--white);
  font-size: 12px;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center;
}
.nav-user-name { font-size: 13px; color: var(--m1); }
.nav-plan {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--og);
  color: var(--orange);
  border: 1px solid rgba(255,101,0,.25);
  font-family: var(--mono);
}
.nav-chevron { font-size: 10px; color: var(--m2); }

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--s1);
  border: 1px solid var(--b2);
  border-radius: 8px;
  padding: 6px;
  z-index: 500;
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
  animation: fadeUp .15s ease;
}
.nav-user-menu.open .nav-dropdown { display: flex; flex-direction: column; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

.nav-dropdown a {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--m1);
  border-radius: 4px;
  transition: background .15s, color .15s;
  display: block;
}
.nav-dropdown a:hover { background: var(--s2); color: var(--white); }
.nav-dropdown-divider {
  height: 1px;
  background: var(--b2);
  margin: 4px 0;
}

/* ── Step indicator (para onboarding multi-step) ── */
.auth-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}
.step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--b3);
  transition: background .2s, width .2s;
}
.step-dot.active {
  background: var(--orange);
  width: 24px;
  border-radius: 4px;
}
.step-dot.done { background: var(--m2); }
