/* =========================================================
   app/assets/css/auth.css
   Login y cambio de contraseña.
   ========================================================= */

:root {
  --srg:         #F47920;
  --srg-dark:    #d8650e;
  --bg-page:     #f4f5f7;
  --bg-card:     #ffffff;
  --bg-input:    #f7f8fa;
  --border:      #e0e4ea;
  --border-soft: #eaedf2;
  --text:        #1e293b;
  --text-dim:    #4b5563;
  --text-faint:  #9ca3af;
  --ok:          #10b981;
  --warn:        #f59e0b;
  --err:         #ef4444;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 8px 32px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
  --font-ui:     system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; min-height: 100vh;
  color: var(--text);
  font: 15px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  /* Fondo con patrón sutil */
  background:
    radial-gradient(ellipse at 20% 50%, rgba(244,121,32,.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(244,121,32,.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(59,130,246,.03) 0%, transparent 50%),
    var(--bg-page);
}

a { color: var(--srg); text-decoration: none; }

/* --------- Layout --------- */
.auth-wrap {
  min-height: 100vh; display: grid;
  place-items: center; padding: 24px;
}

.auth-card {
  width: 100%; max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px 24px;
}

/* Logo centrado */
.auth-logo-wrap {
  text-align: center;
  margin-bottom: 24px;
}
.auth-logo-wrap img {
  height: 64px; width: auto;
}
.auth-logo-wrap .app-name {
  font-size: 16px; font-weight: 700;
  color: var(--text); margin-top: 8px;
}
.auth-logo-wrap .app-sub {
  font-size: 12px; color: var(--text-faint);
}

/* --------- Campos --------- */
.field { margin-bottom: 14px; }

.field label {
  display: block; font-size: 11px; color: var(--text-dim);
  margin-bottom: 6px; font-weight: 600;
  letter-spacing: .3px; text-transform: uppercase;
}

.field input[type="text"],
.field input[type="password"] {
  width: 100%; background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px; color: var(--text);
  font: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.field input:focus {
  border-color: var(--srg);
  box-shadow: 0 0 0 3px rgba(244,121,32,.1);
  background: #fff;
}

.field-password { position: relative; }
.field-password input { padding-right: 44px; }
.field-password .toggle {
  position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  background: transparent; border: 0;
  color: var(--text-faint); cursor: pointer;
  display: grid; place-items: center;
  border-radius: 6px;
}
.field-password .toggle:hover {
  color: var(--text); background: var(--bg-input);
}

/* --------- Botones --------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; width: 100%; padding: 12px 16px; border: 0;
  border-radius: var(--radius-sm); font: 600 14px var(--font-ui);
  cursor: pointer; transition: filter .15s, transform .05s;
  color: white;
  background: linear-gradient(135deg, var(--srg) 0%, var(--srg-dark) 100%);
  box-shadow: 0 2px 8px rgba(244,121,32,.2);
}
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.btn-secondary {
  background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: none; color: var(--text);
}

/* --------- Alertas --------- */
.alert {
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 14px;
  border: 1px solid transparent;
  display: flex; gap: 8px; align-items: flex-start;
}
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warn  { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info  { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

.auth-footer {
  margin-top: 18px; font-size: 11px;
  color: var(--text-faint); text-align: center;
}

/* --------- Política contraseña --------- */
.pwd-policy {
  margin-top: 10px; padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 12px;
}
.pwd-policy-title { color: var(--text-dim); margin-bottom: 6px; font-weight: 500; }
.pwd-rule {
  display: flex; align-items: center; gap: 8px; padding: 2px 0;
  color: var(--text-faint); transition: color .15s;
}
.pwd-rule.ok { color: var(--ok); }
.pwd-rule .dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid currentColor;
  display: grid; place-items: center; flex-shrink: 0;
  font-size: 10px; font-weight: 800;
}
.pwd-rule.ok .dot::before { content: '✓'; }

@media (max-width: 480px) {
  .auth-card { padding: 24px 20px; }
}
