/* ==============================================================================
   GRUPO FUNERARIO PERPETUO SOCORRO — SISTEMA DE CAPTURA DE RECIBOS
   ESTILOS PREMIUM DE LA PÁGINA DE AUTENTICACIÓN Y CONTROL DE ACCESO
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-page-start: #0B1914;
  --bg-page-end: #040907;
  --surface-card: rgba(255, 255, 255, 0.98);
  --surface-blur: 16px;
  --color-primary: #0A3D2E;
  --color-primary-hover: #072B20;
  --color-accent-gold: #C5A059;
  --color-accent-gold-soft: rgba(197, 160, 89, 0.15);
  --color-text-main: #0F172A;
  --color-text-secondary: #475569;
  --color-text-muted: #64748B;
  --color-border: #E2E8F0;
  --color-border-focus: #0A3D2E;
  --color-error-bg: #FEF2F2;
  --color-error-border: #FECACA;
  --color-error-text: #B91C1C;
  --color-warning-bg: #FFFBEB;
  --color-warning-border: #FDE68A;
  --color-warning-text: #92400E;
  --color-success-bg: #ECFDF5;
  --color-success-border: #A7F3D0;
  --color-success-text: #065F46;
  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 20%, #132D23 0%, var(--bg-page-start) 45%, var(--bg-page-end) 100%);
  color: var(--color-text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Patrón sutil de fondo geométrico */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(circle at 20% 15%, rgba(197, 160, 89, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 85%, rgba(10, 61, 46, 0.25) 0%, transparent 50%),
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* Contenedor Principal */
.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  animation: fadeInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Tarjeta Principal */
.login-box {
  background: var(--surface-card);
  backdrop-filter: blur(var(--surface-blur));
  -webkit-backdrop-filter: blur(var(--surface-blur));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(226, 232, 240, 0.8);
  padding: 40px 36px 36px 36px;
  position: relative;
  overflow: hidden;
}

/* Franja superior dorada institucional */
.login-box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0A3D2E 0%, #C5A059 50%, #0A3D2E 100%);
}

/* Encabezado y Logo */
.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 16px;
  border: 1px solid #F1F5F9;
}

.login-logo {
  height: 52px;
  width: auto;
  display: block;
}

.login-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-primary);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background-color: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.2px;
}

.security-badge svg {
  width: 13px;
  height: 13px;
  color: var(--color-primary);
}

/* Formulario */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: #94A3B8;
  pointer-events: none;
  transition: color 0.2s ease;
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 42px;
  background-color: #FFFFFF;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  color: var(--color-text-main);
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(10, 61, 46, 0.12);
}

.form-input:focus + .input-icon,
.form-input:focus ~ .input-icon {
  color: var(--color-primary);
}

.input-with-action {
  padding-right: 42px;
}

/* Botón alternar visibilidad de contraseña */
.btn-toggle-pass {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #94A3B8;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.btn-toggle-pass:hover {
  color: var(--color-primary);
  background-color: #F1F5F9;
}

.btn-toggle-pass svg {
  width: 18px;
  height: 18px;
}

/* Indicador de Bloq Mayús */
.caps-warning {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--color-warning-text);
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: 6px;
  padding: 5px 8px;
}

.caps-warning svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Caja de alerta de error */
.alert-error {
  display: none;
  padding: 12px 14px;
  margin-bottom: 20px;
  background-color: var(--color-error-bg);
  border: 1px solid var(--color-error-border);
  border-radius: var(--radius-md);
  color: var(--color-error-text);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  animation: shake 0.4s ease;
}

.alert-error-content {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-error svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Caja de alerta de éxito */
.alert-success {
  display: none;
  padding: 12px 14px;
  margin-bottom: 20px;
  background-color: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  border-radius: var(--radius-md);
  color: var(--color-success-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.alert-success-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Botón de envío */
.btn-submit {
  width: 100%;
  height: 46px;
  background-color: var(--color-primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(10, 61, 46, 0.25);
}

.btn-submit:hover:not(:disabled) {
  background-color: var(--color-primary-hover);
  box-shadow: 0 6px 16px rgba(10, 61, 46, 0.35);
  transform: translateY(-1px);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none !important;
}

/* Spinner animado */
.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #FFFFFF;
  animation: spin 0.8s linear infinite;
}

/* Footer de la tarjeta */
.login-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #F1F5F9;
  text-align: center;
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.login-footer p strong {
  color: #334155;
}

.system-copyright {
  text-align: center;
  margin-top: 14px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.2px;
}

.system-copyright + .system-copyright {
  margin-top: 4px;
}

.system-copyright a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

.system-copyright a:hover {
  color: var(--color-accent-gold, #C5A059);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Animaciones */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Adaptación responsiva para móviles */
@media (max-width: 480px) {
  body {
    padding: 16px;
  }
  .login-box {
    padding: 28px 22px 24px 22px;
  }
  .login-title {
    font-size: 15px;
  }
  .login-subtitle {
    font-size: 12px;
  }
  .form-input {
    height: 42px;
    font-size: 14px;
  }
  .btn-submit {
    height: 44px;
  }
}
