/* ===== SARA SOLUCIONES — SST LOGIN SYSTEM ===== */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --petrol-950:  #080f14;
  --petrol-900:  #0d1e2b;
  --petrol-800:  #0d2233;
  --petrol-700:  #163345;
  --petrol-600:  #1a3a4a;
  --petrol-400:  #2a5572;
  --petrol-200:  #4d7e99;
  --petrol-100:  #d0e8f2;

  --gold-500:    #c9a227;
  --gold-400:    #d4ae3a;
  --gold-300:    #e8c55a;
  --gold-200:    #f2d98a;
  --gold-100:    #fdf6e3;
  --gold-glow:   rgba(201,162,39,0.15);

  --white:       #ffffff;
  --gray-50:     #f5f6f7;
  --gray-100:    #e8ecf0;
  --gray-300:    #b8c4ce;
  --gray-500:    #6e8090;
  --gray-700:    #384959;
  --black:       #0a0d0f;

  --shadow-sm:   0 2px 8px rgba(8,15,20,0.10);
  --shadow-md:   0 8px 32px rgba(8,15,20,0.15);
  --shadow-lg:   0 24px 80px rgba(8,15,20,0.25);
  --shadow-gold: 0 8px 28px rgba(201,162,39,0.22);

  --radius:      18px;
  --radius-sm:   10px;
  --transition:  all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--petrol-900);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Rejilla industrial sutil */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(201,162,39,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,162,39,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Gradiente ambiental */
body::after {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 65% 55% at 15% 20%, rgba(201,162,39,0.07) 0%, transparent 55%),
    radial-gradient(ellipse 55% 65% at 85% 80%, rgba(13,34,51,0.9)    0%, transparent 60%);
  pointer-events: none;
}

/* ===== CARD PRINCIPAL ===== */
.auth-wrapper {
  position: relative; z-index: 10;
  width: 940px; max-width: 97vw;
  display: flex;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: cardIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  border: 1px solid rgba(201,162,39,0.15);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(40px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== PANEL IZQUIERDO ===== */
.auth-panel {
  width: 360px; flex-shrink: 0;
  background: linear-gradient(170deg, var(--petrol-700) 0%, var(--petrol-900) 55%, var(--petrol-950) 100%);
  padding: 52px 40px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}

/* Puntos industriales */
.auth-panel::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(201,162,39,0.07) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
}

/* Arco dorado decorativo */
.auth-panel::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  border: 1px solid rgba(201,162,39,0.09);
  bottom: -130px; right: -130px;
  pointer-events: none;
}

.panel-logo {
  display: flex; align-items: center; gap: 14px;
  position: relative; z-index: 1;
}

.panel-logo-img {
  width: 54px; height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(201,162,39,0.45);
  box-shadow: 0 0 0 5px rgba(201,162,39,0.08), 0 4px 16px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.panel-logo-text {
  font-family: 'Cinzel', serif;
  font-size: 0.98rem;
  color: var(--gold-300);
  letter-spacing: 0.05em;
  line-height: 1.3;
}

.panel-logo-sub {
  font-size: 0.64rem;
  font-weight: 500;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 3px;
  display: block;
}

.panel-body { position: relative; z-index: 1; }

/* Iconos SST decorativos */
.panel-icon-row {
  display: flex; gap: 10px;
  margin-bottom: 22px;
}

.panel-icon-badge {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(201,162,39,0.09);
  border: 1px solid rgba(201,162,39,0.18);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-400);
  font-size: 1rem;
}

.panel-tagline {
  font-family: 'Cinzel', serif;
  font-size: 1.55rem;
  color: var(--white);
  line-height: 1.38;
  margin-bottom: 14px;
}

.panel-tagline span { color: var(--gold-300); }

.panel-desc {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.42);
  line-height: 1.78;
}

/* Chips certificaciones */
.panel-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 26px;
}

.panel-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  background: rgba(201,162,39,0.08);
  border: 1px solid rgba(201,162,39,0.18);
  border-radius: 20px;
  font-size: 0.65rem; font-weight: 600;
  color: rgba(201,162,39,0.72);
  letter-spacing: 0.07em; text-transform: uppercase;
}

.panel-footer {
  position: relative; z-index: 1;
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 20px;
}

.panel-footer-text {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.07em; text-transform: uppercase;
}

/* ===== PANEL DERECHO ===== */
.auth-form-area {
  flex: 1;
  padding: 52px 52px;
  display: flex; flex-direction: column; justify-content: center;
  background: var(--white);
  position: relative;
}

/* Línea dorada decorativa superior */
.auth-form-area::before {
  content: '';
  position: absolute;
  top: 0; left: 52px; right: 52px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-400), transparent);
  opacity: 0.3;
}

.form-header { margin-bottom: 32px; }

.form-eyebrow {
  font-size: 0.66rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-500); margin-bottom: 8px;
}

.form-title {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  color: var(--petrol-800); line-height: 1.2;
}

.form-subtitle {
  font-size: 0.855rem; color: var(--gray-500);
  margin-top: 8px; line-height: 1.65;
}

/* ===== INPUTS ===== */
.field { margin-bottom: 20px; }

.field-label {
  display: block;
  font-size: 0.7rem; font-weight: 600;
  color: var(--gray-700);
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 8px;
}

.field-wrap { position: relative; }

.field-wrap input,
.field-input {
  width: 100%;
  padding: 13px 46px 13px 16px;
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem; color: var(--black);
  background: var(--gray-50);
  transition: var(--transition); outline: none;
  -webkit-appearance: none;
}

.field-wrap input:focus,
.field-input:focus {
  border-color: var(--gold-400);
  background: var(--white);
  box-shadow: 0 0 0 4px var(--gold-glow);
}

.field-wrap input::placeholder { color: var(--gray-300); }

.field-icon {
  position: absolute; right: 15px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-300); font-size: 0.82rem;
  pointer-events: none; transition: color 0.25s;
}

.field-wrap:focus-within .field-icon { color: var(--gold-400); }

/* ===== BOTÓN PRINCIPAL ===== */
.btn-primary-custom {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 14px 24px;
  background: linear-gradient(135deg, var(--petrol-700) 0%, var(--petrol-950) 100%);
  color: var(--gold-300);
  border: 1px solid rgba(201,162,39,0.22);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem; font-weight: 600; letter-spacing: 0.04em;
  cursor: pointer; transition: var(--transition);
  text-decoration: none; text-align: center;
  position: relative; overflow: hidden;
}

.btn-primary-custom::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--petrol-600) 0%, var(--petrol-800) 100%);
  opacity: 0; transition: opacity 0.3s;
}

.btn-primary-custom > * { position: relative; z-index: 1; }

.btn-primary-custom:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
  border-color: rgba(201,162,39,0.4);
  color: var(--gold-200);
}

.btn-primary-custom:hover::after { opacity: 1; }
.btn-primary-custom:active { transform: translateY(0); }

/* ===== BOTÓN OUTLINE ===== */
.btn-outline-custom {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 13px 24px;
  background: transparent;
  color: var(--gray-700);
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem; font-weight: 500;
  cursor: pointer; transition: var(--transition);
  text-decoration: none; text-align: center;
}

.btn-outline-custom:hover {
  border-color: rgba(201,162,39,0.5);
  color: var(--petrol-700);
  background: var(--gold-100);
}

/* ===== DIVISOR ===== */
.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0;
  color: var(--gray-300);
  font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--gray-100);
}

/* ===== LINKS ===== */
.form-link {
  color: var(--petrol-600); font-size: 0.855rem; font-weight: 500;
  text-decoration: none; transition: color 0.2s;
}
.form-link:hover { color: var(--gold-500); }

.form-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}

.checkbox-custom {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.84rem; color: var(--gray-500); cursor: pointer;
}

.checkbox-custom input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--gold-500); cursor: pointer;
}

.back-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.8rem; font-weight: 500;
  color: var(--gray-500); text-decoration: none;
  transition: var(--transition); margin-bottom: 26px;
}
.back-link:hover { color: var(--petrol-700); transform: translateX(-3px); }

/* ===== ALERTAS ===== */
.alert-custom {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 0.82rem; margin-bottom: 16px;
  display: flex; gap: 10px; align-items: flex-start; line-height: 1.55;
}

.alert-error { background: #fff5f5; border: 1px solid #fdd; color: #c0392b; }
.alert-info  { background: var(--gold-100); border: 1px solid rgba(201,162,39,0.3); color: var(--petrol-700); }

.field-error {
  font-size: 0.78rem; color: #c0392b;
  margin-top: 6px; display: flex; align-items: center; gap: 5px;
}

/* ===== STATUS CARD ===== */
.status-card { text-align: center; padding: 24px 0; }

.status-icon {
  width: 84px; height: 84px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px; font-size: 2.1rem;
}

.status-icon-success {
  background: linear-gradient(135deg, var(--petrol-700), var(--petrol-950));
  color: var(--gold-300);
  box-shadow: var(--shadow-gold);
  border: 1px solid rgba(201,162,39,0.25);
}

.status-icon-email {
  background: var(--gold-100);
  color: var(--gold-500);
  border: 1px solid rgba(201,162,39,0.3);
}

.status-title {
  font-family: 'Cinzel', serif; font-size: 1.4rem;
  color: var(--petrol-800); margin-bottom: 12px;
}

.status-desc {
  font-size: 0.875rem; color: var(--gray-500);
  line-height: 1.75; max-width: 340px; margin: 0 auto 28px;
}

.info-box {
  background: var(--gold-100);
  border: 1px solid rgba(201,162,39,0.28);
  border-radius: var(--radius-sm);
  padding: 14px 16px; font-size: 0.82rem; color: var(--petrol-700);
  text-align: left; margin-bottom: 24px;
  display: flex; gap: 10px; align-items: flex-start; line-height: 1.55;
}
.info-box i { color: var(--gold-500); margin-top: 2px; flex-shrink: 0; }

/* ===== INVALID LINK ===== */
.invalid-state { text-align: center; padding: 10px 0; }

.invalid-icon {
  width: 84px; height: 84px; border-radius: 50%;
  background: #fff5f5; color: #c0392b; font-size: 2.1rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px; border: 1px solid #fdd;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed; top: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 10px; max-width: 320px;
}

.toast-alert {
  background: var(--white); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); padding: 14px 16px;
  border-left: 4px solid var(--gold-400);
  font-size: 0.84rem; color: var(--gray-700);
  animation: slideIn 0.3s ease both;
}

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

/* ═══════════════════════════════════════
   RESPONSIVE — Tablet y Móvil
   ═══════════════════════════════════════ */

/* ── Tablet (≤ 860px) ── */
@media (max-width: 860px) {
  .auth-wrapper {
    width: 98vw;
  }

  .auth-panel {
    width: 300px;
    padding: 40px 28px;
  }

  .panel-tagline {
    font-size: 1.35rem;
  }

  .auth-form-area {
    padding: 40px 36px;
  }
}

/* ── Móvil (≤ 640px) ── */
@media (max-width: 640px) {

  body {
    align-items: flex-start;
    overflow-y: auto;
    padding: 0;
    background: var(--petrol-900);
  }

  /* La card ocupa toda la pantalla y se apila verticalmente */
  .auth-wrapper {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    animation: none;
  }

  /* ── Panel izquierdo compacto en móvil ── */
  .auth-panel {
    width: 100%;
    padding: 28px 24px 24px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    /* Ocultar decoraciones grandes */
    min-height: auto;
  }

  /* Ocultar elementos decorativos que no caben */
  .auth-panel .panel-body,
  .auth-panel .panel-footer,
  .auth-panel .panel-chips {
    display: none;
  }

  /* Solo mostrar el logo en horizontal */
  .auth-panel .panel-logo {
    margin: 0;
  }

  .panel-logo-img {
    width: 46px;
    height: 46px;
  }

  .panel-logo-text {
    font-size: 0.92rem;
  }

  .panel-logo-sub {
    font-size: 0.6rem;
  }

  /* ── Área del formulario ── */
  .auth-form-area {
    flex: 1;
    padding: 32px 24px 40px;
    justify-content: flex-start;
  }

  /* Quitar la línea dorada superior */
  .auth-form-area::before {
    display: none;
  }

  .back-link {
    margin-bottom: 20px;
  }

  .form-header {
    margin-bottom: 24px;
  }

  .form-title {
    font-size: 1.4rem;
  }

  .form-subtitle {
    font-size: 0.84rem;
  }

  /* Inputs más cómodos para el dedo */
  .field-wrap input,
  .field-input {
    padding: 14px 46px 14px 16px;
    font-size: 1rem;       /* evita zoom automático en iOS */
  }

  .field {
    margin-bottom: 18px;
  }

  .form-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
  }

  /* Botones con altura cómoda para touch */
  .btn-primary-custom,
  .btn-outline-custom {
    padding: 15px 20px;
    font-size: 0.95rem;
  }

  .divider {
    margin: 16px 0;
  }

  /* Status cards (reset password, éxito, etc.) */
  .status-card {
    padding: 16px 0;
  }

  .status-icon {
    width: 72px;
    height: 72px;
    font-size: 1.8rem;
  }

  .status-title {
    font-size: 1.25rem;
  }

  .status-desc {
    font-size: 0.845rem;
    max-width: 100%;
  }

  .info-box {
    font-size: 0.82rem;
  }

  /* Invalid state */
  .invalid-icon {
    width: 72px;
    height: 72px;
    font-size: 1.8rem;
  }
}

/* ── Móvil muy pequeño (≤ 380px) ── */
@media (max-width: 380px) {
  .auth-form-area {
    padding: 24px 18px 36px;
  }

  .form-title {
    font-size: 1.25rem;
  }

  .btn-primary-custom,
  .btn-outline-custom {
    font-size: 0.88rem;
  }
}