/* ============================================================
   Portal CIDERT — Auth Pages
   ============================================================ */

.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* ── Left panel ──────────────────────────────────────────── */
.auth-panel-left {
  background: var(--azul-900);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 6vw, 80px);
  position: relative;
  overflow: hidden;
}

.auth-panel-left::before {
  content: '';
  position: absolute;
  bottom: -120px;
  left: -120px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,.03);
}

.auth-panel-left::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(78,139,87,.08);
}

.auth-logo {
  margin-bottom: 48px;
  position: relative;
  z-index: 1;
}

.auth-logo img {
  height: 40px;
  width: auto;
}

.auth-headline {
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.auth-headline em {
  font-style: normal;
  color: var(--verde-300);
}

.auth-desc {
  font-size: 15px;
  color: rgba(255,255,255,.6);
  line-height: 1.7;
  max-width: 380px;
  position: relative;
  z-index: 1;
}

.auth-features {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(255,255,255,.7);
}

.auth-feature-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--verde);
  flex-shrink: 0;
}

/* ── Right panel ─────────────────────────────────────────── */
.auth-panel-right {
  background: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 6vw, 80px);
  overflow-y: auto;
}

.auth-form-wrap {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.auth-form-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.auth-form-subtitle {
  font-size: 14px;
  color: var(--mut);
  margin-bottom: 32px;
}

/* ── Form elements ───────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gris);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper-2);
  color: var(--ink);
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  transition: border-color 0.18s, box-shadow 0.18s;
  outline: none;
}

.form-control:focus {
  border-color: var(--azul);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15,53,87,.08);
}

.form-control.is-invalid {
  border-color: #dc3545;
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220,53,69,.1);
}

.invalid-feedback {
  font-size: 12px;
  color: #dc3545;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.form-text {
  font-size: 12px;
  color: var(--mut);
  margin-top: 5px;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A8579' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gris);
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--azul);
  cursor: pointer;
}

/* ── Auth button ─────────────────────────────────────────── */
.btn-auth {
  width: 100%;
  padding: 13px;
  background: var(--azul);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s var(--ease), transform 0.1s;
  margin-top: 8px;
}

.btn-auth:hover {
  background: var(--azul-700);
  transform: translateY(-1px);
}

.btn-auth:active { transform: translateY(0); }

.btn-auth:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

/* ── Auth links ──────────────────────────────────────────── */
.auth-link-row {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--mut);
}

.auth-link-row a {
  color: var(--azul);
  font-weight: 600;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--mut);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ── Role selector ───────────────────────────────────────── */
.role-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 6px;
}

.role-option {
  position: relative;
}

.role-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.role-option label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.18s var(--ease);
  text-align: center;
  background: var(--paper-2);
}

.role-option label:hover {
  border-color: var(--azul);
  background: #fff;
}

.role-option input:checked + label {
  border-color: var(--azul);
  background: rgba(15,53,87,.05);
  color: var(--azul);
}

.role-option-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
}

.role-option input:checked + label .role-option-icon {
  background: var(--azul);
}

.role-option-icon svg { width: 18px; height: 18px; color: var(--azul); }
.role-option input:checked + label .role-option-icon svg { color: #fff; }

.role-option-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.role-option-desc {
  font-size: 10px;
  color: var(--mut);
  line-height: 1.3;
}

/* ── Password toggle ─────────────────────────────────────── */
.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  width: 40px;
  background: none;
  border: none;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  cursor: pointer;
  color: var(--mut);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
  padding: 0;
}

.password-toggle:hover { color: var(--azul); }
.password-toggle svg { width: 18px; height: 18px; flex: none; }
.password-toggle .icon-hide { display: none; }
.password-toggle.visible .icon-show { display: none; }
.password-toggle.visible .icon-hide { display: block; }

/* ── Password strength ───────────────────────────────────── */
.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.strength-bar {
  height: 3px;
  flex: 1;
  border-radius: 2px;
  background: var(--line);
  transition: background 0.3s;
}

.strength-bar.weak   { background: #dc3545; }
.strength-bar.medium { background: var(--tierra); }
.strength-bar.strong { background: var(--verde); }

.strength-label {
  font-size: 11px;
  color: var(--mut);
  margin-top: 5px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .auth-wrap {
    grid-template-columns: 1fr;
  }

  .auth-panel-left {
    display: none;
  }

  .auth-panel-right {
    padding: 32px 24px;
    justify-content: flex-start;
    padding-top: 48px;
  }

  .auth-mobile-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
  }
}

.auth-mobile-logo {
  display: none;
}

@media (max-width: 400px) {
  .role-selector { grid-template-columns: 1fr; }
}
