/* ============================================================
 * MATERIAL YOU 3 + ANDROID 16 CRYSTAL — LOGIN
 * Sistema de Almacenes y Activos Fijos - G.A.M.
 * ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

:root {
  --md-primary: #1a6b8a;
  --md-on-primary: #ffffff;
  --md-primary-container: #c4e7f7;
  --md-on-primary-container: #001e2e;
  --md-surface: #fdfcff;
  --md-on-surface: #191c20;
  --md-on-surface-variant: #43474e;
  --md-outline: #73777f;
  --md-outline-variant: #c3c7cf;
  --md-error: #ba1a1a;
  --md-error-container: #ffdad6;
  --md-elevation: 0 2px 8px rgba(0,0,0,0.08), 0 8px 32px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --radius-pill: 9999px;
}

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

html, body { height: 100%; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #081a2e 0%, #0d2137 40%, #1a3a5c 70%, #1a6b8a 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
}

/* Animated gradient orbs */
body::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 20%, rgba(79, 195, 247, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 75%, rgba(129, 199, 132, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.02) 0%, transparent 40%);
  pointer-events: none;
}

/* Subtle pattern */
body::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 390px;
  padding: 16px;
  animation: loginFadeIn 0.5s ease-out;
}

@keyframes loginFadeIn {
  from { opacity: 0; transform: translateY(32px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Crystal Glass Card --- */
.login-card {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: var(--radius-lg);
  box-shadow: var(--md-elevation);
  overflow: hidden;
}

.login-header {
  background: linear-gradient(135deg, rgba(13, 33, 55, 0.92), rgba(26, 58, 92, 0.88));
  color: white;
  padding: 38px 28px 26px;
  text-align: center;
  position: relative;
}

.login-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4fc3f7, #1a6b8a, #4fc3f7);
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 100% 0%; }
}

.login-header .logo-circle {
  width: 76px; height: 76px;
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s;
}
.login-header .logo-circle:hover { transform: scale(1.06); }
.login-header .logo-circle img { width: 100%; height: 100%; object-fit: contain; }

.login-header h1 {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0 0 3px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.95;
}
.login-header p {
  font-size: 0.78rem;
  margin: 0;
  opacity: 0.7;
}

.login-body { padding: 28px 28px 16px; }

.login-body .form-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--md-on-surface-variant);
  margin-bottom: 4px;
}

.login-body .input-group { border-radius: var(--radius-sm); overflow: hidden; }

.login-body .input-group-text {
  background: transparent;
  border: 1.5px solid var(--md-outline-variant);
  border-right: none;
  color: var(--md-on-surface-variant);
  padding: 12px 14px;
  transition: all 0.2s;
  font-size: 1rem;
}

.login-body .form-control {
  border: 1.5px solid var(--md-outline-variant);
  border-left: none;
  padding: 12px 14px 12px 0;
  font-size: 0.9rem;
  transition: all 0.2s;
  background: transparent;
  font-family: inherit;
}
.login-body .form-control:focus { border-color: var(--md-primary); box-shadow: none; outline: none; }

.login-body .input-group:focus-within .input-group-text {
  border-color: var(--md-primary);
  color: var(--md-primary);
  background: rgba(26, 107, 138, 0.04);
}

.login-body .password-toggle {
  border: 1.5px solid var(--md-outline-variant);
  border-left: none;
  background: transparent;
  color: var(--md-outline);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  transition: all 0.2s;
  cursor: pointer;
}
.login-body .password-toggle:hover { color: var(--md-primary); }
.login-body .input-group:focus-within .password-toggle { border-color: var(--md-primary); }

/* --- M3 Filled Button (pill) --- */
.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--md-primary);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.25s;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(26, 107, 138, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-login:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(26, 107, 138, 0.4);
  color: white;
}

.btn-login:active:not(:disabled) { transform: translateY(0); }
.btn-login:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Alerts (crystal) --- */
.alert {
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  border: none;
  padding: 10px 14px;
  margin: 0 28px;
}
.alert-dismissible .btn-close { font-size: 0.75rem; }

/* --- Footer (crystal) --- */
.login-footer {
  text-align: center;
  padding: 14px 28px 20px;
  color: var(--md-outline);
  font-size: 0.68rem;
  border-top: 1px solid var(--md-outline-variant);
}
.login-footer strong { color: var(--md-primary); }

/* --- Credentials hint (crystal) --- */
.credentials-hint {
  background: rgba(26, 107, 138, 0.04);
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 14px 0 0;
}
.credentials-hint .title {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--md-primary);
  margin-bottom: 6px;
}
.credentials-hint code {
  font-size: 0.75rem;
  background: rgba(26, 107, 138, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--md-on-primary-container);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .login-header { padding: 26px 20px 20px; }
  .login-body { padding: 22px 20px 14px; }
  .login-footer { padding: 12px 20px 14px; }
  .login-header h1 { font-size: 0.82rem; }
  .login-header .logo-circle { width: 64px; height: 64px; }
  .alert { margin: 0 20px; }
  .credentials-hint { margin: 14px 20px 0; }
}
