/* Login CSS - Corporación Adesur SAC */
*, *::before, *::after { box-sizing: border-box; }
* { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', sans-serif; }

:root {
  --brand-primary: #0369a1; /* sky-700 */
  --brand-primary-2: #0ea5e9; /* sky-500 */
  --brand-dark: #0c4a6e; /* sky-900 */
  --focus: #0ea5e9;
  --success: #22c55e;
  --danger: #dc2626;
}

html, body { height: 100%; }
body {
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 50%, #e0f2fe 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 20px;
}

.login-container {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 25px 80px rgba(3, 105, 161, .15), 0 10px 30px rgba(0,0,0,.08);
  overflow: hidden;
  max-width: 950px;
  width: 100%;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 620px;
  animation: slideIn .6s ease-out;
}

@keyframes slideIn { from { opacity: 0; transform: translateY(30px);} to { opacity: 1; transform: translateY(0);} }

.login-brand {
  background: linear-gradient(145deg, var(--brand-primary) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 50px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-brand::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,.1) 0%, transparent 70%);
  pointer-events: none;
}

.brand-content { position: relative; z-index: 2; text-align: center; }

.brand-logo {
  width: 90px; height: 90px;
  background: rgba(255,255,255,.15);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 25px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.25);
}

.brand-logo .logo-img { max-width: 70px; max-height: 70px; object-fit: contain; }

/* Logo ancho para empresas con logo horizontal */
.brand-logo-wide {
  background: rgba(255,255,255,.95);
  border-radius: 16px;
  padding: 15px 25px;
  margin: 0 auto 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0,0,0,.1);
}

.brand-logo-wide .logo-img-wide {
  max-width: 220px;
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.brand-text { margin-bottom: 30px; color: #fff !important; }
.brand-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 5px; letter-spacing: 0.03em; text-shadow: 0 2px 8px rgba(0,0,0,.2); color: #fff !important; }
.brand-tagline { font-size: 1.1rem; opacity: .9; font-weight: 300; letter-spacing: 0.15em; margin: 0; color: #fff !important; }

.brand-description { margin-top: 20px; color: #fff !important; }
.brand-description .brand-subtitle { font-size: 1rem; opacity: .9; font-weight: 400; margin-bottom: 25px; color: #fff !important; }

.brand-features { text-align: left; max-width: 240px; margin: 0 auto; color: #fff !important; }
.feature-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; font-size: .95rem; opacity: .95; color: #fff !important; }
.feature-item span { color: #fff !important; }
.feature-icon { width: 22px; height: 22px; background: rgba(255,255,255,.25); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .75rem; color: #fff !important; }

.brand-footer { position: relative; z-index: 2; text-align: center; opacity: .8; font-size: .8rem; margin-top: 30px; color: #fff !important; }
.brand-footer small { color: #fff !important; }

.login-form { padding: 50px 45px; display: flex; flex-direction: column; justify-content: center; }
.form-header { text-align: center; margin-bottom: 35px; }
.form-logo-mobile { display: none; margin-bottom: 15px; }
.form-title { font-size: 1.75rem; font-weight: 600; color: #1f2937; margin-bottom: 8px; }
.form-subtitle { color: #6b7280; font-size: .95rem; margin: 0; }

.form-group { margin-bottom: 22px; }
.form-label { display: flex; align-items: center; margin-bottom: 8px; font-weight: 500; color: #374151; font-size: .95rem; }
.form-hint { display: block; color: #9ca3af; font-size: .8rem; margin-top: 6px; }
.form-control { width: 100%; padding: 14px 18px; border: 2px solid #e5e7eb; border-radius: 12px; font-size: 1rem; transition: all .25s ease; background: #f9fafb; }
.form-control:focus { outline: none; border-color: var(--focus); background: #fff; box-shadow: 0 0 0 3px rgba(14,165,233,.15); }
.form-control.is-valid { border-color: var(--success); background: #f0fdf4; }
.form-control.is-invalid { border-color: var(--danger); background: #fef2f2; }
.form-control:invalid { box-shadow: none; }
.form-control::placeholder { color: #9ca3af; }

.input-group { position: relative; }
.input-group .form-control { padding-right: 50px; }
.toggle-password { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #6b7280; cursor: pointer; padding: 4px; transition: color .2s; }
.toggle-password:hover { color: var(--brand-primary); }
.toggle-password:focus-visible { outline: 2px solid var(--focus); border-radius: 6px; }

.form-options { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 10px; }
.form-check { display: flex; align-items: center; margin: 0; }
.form-check-input { margin-right: 8px; border-radius: 4px; accent-color: var(--brand-primary); width: 16px; height: 16px; cursor: pointer; }
.form-check-label { font-size: .9rem; color: #4b5563; cursor: pointer; }
.forgot-link { color: var(--brand-primary); text-decoration: none; font-size: .9rem; font-weight: 500; }
.forgot-link:hover { text-decoration: underline; }

.btn { font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { width: 100%; padding: 15px; background: linear-gradient(135deg, var(--brand-primary-2) 0%, var(--brand-primary) 100%); color: #fff; border: none; border-radius: 12px; font-weight: 600; font-size: 1rem; transition: all .2s ease; cursor: pointer; letter-spacing: .02em; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(14,165,233,.35); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-loading { display: flex; align-items: center; gap: 8px; }
.spinner-icon { animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg);} 100% { transform: rotate(360deg);} }

.alert { border-radius: 12px; border: none; padding: 14px 16px; margin-bottom: 20px; }
.alert ul { margin: 0; padding-left: 18px; }
.alert-danger { background: #fef2f2; color: var(--danger); border-left: 4px solid var(--danger); }
.alert-success { background: #f0fdf4; color: #166534; border-left: 4px solid var(--success); }

.footer-info { text-align: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid #e5e7eb; }
.support-info p { color: #9ca3af; font-size: .85rem; margin: 0 0 8px; }
.support-link { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-primary); text-decoration: none; font-weight: 500; font-size: .9rem; }
.support-link:hover { text-decoration: underline; }

/* Feedback y utilidades */
.invalid-feedback { color: var(--danger); font-size: .8rem; margin-top: .25rem; display: none; }
.form-control.is-invalid ~ .invalid-feedback { display: block; }
.text-decoration-none { text-decoration: none; }

/* Loading */
.loading { display: none; text-align: center; margin-top: 20px; }
.spinner { border: 3px solid #f3f3f3; border-top: 3px solid var(--brand-primary); border-radius: 50%; width: 30px; height: 30px; animation: spin 1s linear infinite; display: inline-block; }

/* Utilities */
.d-none { display: none !important; }
.text-danger { color: var(--danger); }
.small { font-size: .875rem; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: .75rem; }
.text-muted { color: #6b7280; }

/* Responsive */
@media (max-width: 768px) {
  body { padding: 10px; }
  .login-container { grid-template-columns: 1fr; max-width: 100%; margin: 10px; min-height: auto; border-radius: 16px; }
  .login-brand { display: none; }
  .login-form { padding: 30px 20px; }
  .form-logo-mobile { display: block; }
  .form-header { margin-bottom: 25px; }
  .form-title { font-size: 1.4rem; }
  .form-subtitle { font-size: .85rem; }
  .form-group { margin-bottom: 16px; }
  .form-control { padding: 12px 14px; font-size: .95rem; border-radius: 10px; }
  .form-options { flex-direction: column; align-items: flex-start; gap: 12px; }
  .btn-primary { padding: 12px; font-size: .95rem; border-radius: 10px; }
  .footer-info { margin-top: 20px; padding-top: 15px; }
  .support-info p { font-size: .8rem; }
  .support-link { font-size: .85rem; }
}

@media (max-width: 400px) {
  .login-container { margin: 5px; }
  .login-form { padding: 25px 15px; }
  .form-title { font-size: 1.2rem; }
  .form-control { padding: 10px 12px; }
}
