/* ==========================================================================
   Portal Corredores MVP – Login
   ========================================================================== */

/* ==============
   01) Variables
   ============== */
:root {
  --brand: #249696;
  --brand-600: #1c3c5f;
  --page-top: #f4f7fb;
  --bg: #f6f6f6;
  --text: #333;
  --muted: #666;
  --line: #d9dee7;
  --ring: rgba(2,95,142,0.15);

  --card-bg: rgba(255,255,255,0.94);
  --card-line: rgba(0,0,0,0.06);
  --shadow-s: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-l: 0 12px 32px rgba(0,0,0,0.10);
  --shadow-h: 0 26px 60px -12px rgba(0,0,0,0.16);

  --radius-s: 100px;
  --radius-m: 12px;

  --font: Rubik, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* =======================
   02) Reset
   ======================= */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font);
}

/* ==========================================
   03) Layout
   ========================================== */
.login-container {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 16px;
  background:
    radial-gradient(1100px 520px at 50% 12%, rgba(2,95,142,0.08), transparent 60%),
    linear-gradient(180deg, var(--page-top), #fff);
}

/* ============================
   04) Card
   ============================ */
.login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 40px 32px;
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--card-line);
  border-radius: var(--radius-m);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-s), var(--shadow-l);
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: -20px;
  border-radius: 16px;
  pointer-events: none;
  background: radial-gradient(420px 220px at 50% -10%, rgba(2,95,142,0.10), transparent 60%);
  filter: blur(8px);
  z-index: -1;
}

.login-card:hover,
.login-card:focus-within {
  box-shadow:
    0 6px 16px rgba(0,0,0,0.10),
    var(--shadow-h),
    0 0 0 6px rgba(2,95,142,0.07);
  transform: translateY(-1px);
}

/* --- Logo --- */
.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.login-logo img {
  height: 48px;
  max-width: 120px;
  object-fit: contain;
}

/* ===========================
   05) Textos
   =========================== */
h1 {
  margin: 0 0 10px 0;
  color: var(--brand-600);
  font-weight: 600;
  letter-spacing: -0.2px;
}

#step-title {
  margin: 4px 0 16px 0;
  color: var(--muted);
}

/* ===========================
   06) Formularios
   =========================== */
form { margin: 18px 0; }

input {
  width: 100%;
  padding: 12px 12px;
  margin-bottom: 12px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
  border: 1px solid #cfcfcf;
  border-radius: var(--radius-s);
  outline: none;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--ring);
}

input::placeholder {
  color: #999;
}

/* ===========================
   07) Botones
   =========================== */
button {
  width: 100%;
  min-height: 44px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-m);
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  outline: none;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease,
    opacity 120ms ease;
}

button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(2,95,142,.28);
  background: var(--brand-600);
}

button:not(:disabled):active {
  transform: translateY(0);
  box-shadow: none;
}

button:focus-visible {
  box-shadow:
    0 0 0 4px rgba(2,95,142,.18),
    0 8px 18px rgba(2,95,142,.24);
}

button:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===========================
   08) Botones de elección
   =========================== */
#login-choice {
  display: grid;
  gap: 14px;
}

.choice-btn.alt {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--line);
}

.choice-btn.alt:not(:disabled):hover {
  background: #f7fbff;
  box-shadow: none;
  transform: translateY(0);
  border-color: var(--brand);
}

/* ===========================
   09) Links
   =========================== */
a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

a:hover { text-decoration: underline; }

/* ===========================
   10) Status y hints
   =========================== */
.status {
  margin-top: 10px;
  font-size: 14px;
  color: #555;
  min-height: 20px;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0 0;
}

/* ===========================
   11) Success icon
   =========================== */
.success-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  background: #e8f5e9;
  color: #2e7d32;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: bold;
}

#magic-success p {
  margin: 0 0 20px 0;
  color: var(--text);
  line-height: 1.5;
}

/* =======================================
   12) Responsive
   ======================================= */
@media (max-width: 480px) {
  .login-card {
    padding: 32px 20px;
  }
  
  h1 {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  button, .login-card {
    transition: none !important;
  }
}
