/* ============================================================
   vps-auth.css — Login del Centro Unificado CESCAC
   Colores CESCAC: primary #0d9488 (teal), dark #0f172a (slate)
   ============================================================ */

/* ─── Reset base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #0b141a;
  color: #e9edef;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Wrapper ────────────────────────────────────────────── */
.auth-wrapper {
  width: 100%;
  max-width: 420px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* ─── Card ───────────────────────────────────────────────── */
.auth-card {
  width: 100%;
  background: #111b21;
  border: 1px solid #2a3942;
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ─── Logo ────────────────────────────────────────────────── */
.auth-logo {
  text-align: center;
  margin-bottom: 20px;
}

.auth-logo-img {
  max-width: 200px;
  max-height: 64px;
  height: auto;
  object-fit: contain;
}

.cescac-logo-svg {
  width: 64px;
  height: 64px;
  color: #0d9488;
}

/* ─── Title ──────────────────────────────────────────────── */
.auth-title {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 700;
  color: #e9edef;
  text-align: center;
}

.auth-subtitle {
  margin: 0 0 24px;
  font-size: 0.875rem;
  color: #8696a0;
  text-align: center;
}

/* ─── Messages ────────────────────────────────────────────── */
.auth-msg {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.875rem;
  margin-bottom: 16px;
  text-align: center;
  line-height: 1.4;
  transition: opacity 0.2s ease;
}

.auth-msg.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.auth-msg.success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.auth-msg.info {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

.auth-msg.hidden {
  display: none;
}

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

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #8696a0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #2a3942;
  background: #0f172a;
  color: #e9edef;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.4;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.auth-field input::placeholder {
  color: #475569;
}

.auth-field input:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

.auth-field input:-webkit-autofill,
.auth-field input:-webkit-autofill:hover,
.auth-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #e9edef;
  -webkit-box-shadow: 0 0 0 30px #0f172a inset;
  caret-color: #e9edef;
}

/* ─── Button ──────────────────────────────────────────────── */
.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: 10px;
  background: #0d9488;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  position: relative;
}

.auth-btn:hover:not(:disabled) {
  background: #0f766e;
}

.auth-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.auth-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-text,
.btn-loader {
  display: inline-flex;
  align-items: center;
}

.btn-text.hidden,
.btn-loader.hidden {
  display: none;
}

/* ─── Spinner ─────────────────────────────────────────────── */
.spin {
  animation: spin 0.8s linear infinite;
}

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

/* ─── Footer ──────────────────────────────────────────────── */
.auth-footer {
  margin: 20px 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: #475569;
}

.auth-link {
  color: #5eead4;
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-link:hover {
  color: #2dd4bf;
  text-decoration: underline;
}

.auth-version {
  margin: 0;
  font-size: 0.75rem;
  color: #334155;
  text-align: center;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-wrapper {
    padding: 16px;
    justify-content: flex-start;
    padding-top: 48px;
  }

  .auth-card {
    padding: 24px 20px;
    border-radius: 12px;
  }

  .auth-title {
    font-size: 1.2rem;
  }

  .auth-field input {
    font-size: 16px; /* Evitar zoom en iOS */
  }
}
