/* =============================================
   VARIABLES — Paleta UDAI
============================================= */
:root {
  --gold:   #AE7B39;
  --teal:   #166077;
  --navy:   #18223C;
  --light:  #F3F3F4;
  --green:  #5AAA95;
  --sky:    #B1DDF1;
  --white:  #FFFFFF;
  --shadow: 0 8px 32px rgba(24,34,60,0.13);
  --radius: 16px;
}

/* =============================================
   RESET & BASE
============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =============================================
   NAVBAR
============================================= */
.navbar {
  background: var(--navy);
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
  flex-shrink: 0;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.navbar-logo {
  height: 90px;
  width: auto;
  object-fit: contain;
}

.navbar-divider {
  width: 1.5px;
  height: 32px;
  background: rgba(255,255,255,0.3);
  margin: 0 4px;
}

.navbar-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 1.3rem;
  letter-spacing: 0.18em;
  color: var(--white);
}

.brand-sub {
  font-weight: 300;
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
}

/* =============================================
   MAIN
============================================= */
.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

/* =============================================
   LOGIN CARD
============================================= */
.login-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 44px 48px 40px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeUp 0.45s cubic-bezier(.22,1,.36,1) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Logo en card */
.card-logo {
  margin-bottom: 32px;
}

.card-logo-img {
  height: 90px;
  width: auto;
  object-fit: contain;
}

/* =============================================
   FORM
============================================= */
.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--navy);
}

.input-wrapper {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #D8D8DA;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  color: var(--navy);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input::placeholder {
  color: #ABABAB;
  font-weight: 300;
}

.form-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(22,96,119,0.12);
}

.form-input.has-icon {
  padding-right: 44px;
}

/* Toggle contraseña */
.toggle-pass {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #ABABAB;
  display: flex;
  align-items: center;
  padding: 0;
  transition: color 0.2s;
}

.toggle-pass:hover {
  color: var(--teal);
}

/* Botón submit */
.btn-login {
  margin-top: 6px;
  width: 100%;
  padding: 13px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.97rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

.btn-login:hover {
  background: var(--teal);
  box-shadow: 0 4px 16px rgba(22,96,119,0.25);
}

.btn-login:active {
  transform: scale(0.98);
}

.btn-login.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn-login.loading::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Mensaje de error */
.error-msg {
  display: none;
  width: 100%;
  background: #FEE;
  border: 1px solid #F5C6C6;
  border-radius: 8px;
  color: #C0392B;
  font-size: 0.83rem;
  padding: 10px 14px;
  text-align: center;
  margin-bottom: 4px;
}

.error-msg.visible {
  display: block;
}

/* Nota de contraseña */
.contact-note {
  text-align: center;
  margin-top: 4px;
  font-size: 0.82rem;
  color: #888;
  line-height: 1.4;
}

.contact-note strong {
  color: var(--teal);
}
