/* ═══════════════════════════════════════════════════════════════
   SIC — Auth Stylesheet compartido
   Path: sic/shared/assets/css/auth.css
   Usado por: login, register, recover, reset (páginas standalone)
   Cargado desde: shared/layouts/minimal_layout.php
   ═══════════════════════════════════════════════════════════════ */

.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
}

/* ─── Brand ─── */
.auth-brand {
  text-align: center;
  margin-bottom: clamp(20px, 5vh, 36px);
}
.auth-brand__icon {
  width: clamp(40px, 10vw, 52px);
  height: clamp(40px, 10vw, 52px);
  background: var(--accent);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1rem, 3vw, 1.4rem);
  color: #fff;
  margin-bottom: clamp(10px, 2vh, 16px);
  box-shadow: 0 0 40px var(--accent-glow);
}
.auth-brand__title {
  font-size: clamp(1.05rem, 3.5vw, 1.3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.auth-brand__sub {
  font-size: clamp(0.7rem, 2.2vw, 0.82rem);
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ─── Card ─── */
.auth-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(22px, 5vw, 32px) clamp(18px, 4vw, 28px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  transition: box-shadow 0.3s;
}
.auth-card:hover {
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}
.auth-card__heading {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
  text-align: center;
}
.auth-card__desc {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary, #9aa0b0);
  margin-bottom: 18px;
}

/* ─── Messages ─── */
.auth-msg {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-bottom: 16px;
  display: none;
  text-align: center;
  line-height: 1.4;
}
.auth-msg.show { display: block; }
.auth-msg--error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
}
.auth-msg--success {
  background: var(--success-bg);
  color: var(--success-text);
}

/* ─── Form Fields ─── */
.auth-form { display: flex; flex-direction: column; gap: 14px; }

.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-field__label {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 2px;
}
.auth-field__wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-field__icon {
  position: absolute;
  left: 13px;
  font-size: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
}
input.auth-field__input {
  width: 100%;
  padding: 11px 13px 11px 38px !important;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font-family), sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
input.auth-field__input::placeholder {
  color: var(--text-muted, rgba(255,255,255,0.35));
}
.auth-field__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--input-focus);
}
.auth-field__input.error {
  border-color: var(--error-text);
  box-shadow: 0 0 0 3px var(--error-bg);
}

/* ─── Two-column row (TS-36 mobile-first → tablet/desktop side-by-side) ─── */
.auth-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ─── Required indicator ─── */
.required {
  color: var(--error-text, #dc2626);
  margin-left: 2px;
}

/* ─── Select con icono ─── */
.auth-field select {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 36px;
}

/* ─── Password toggle ─── */
.auth-field__toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px 6px;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.auth-field__toggle:hover { color: var(--text); }

/* ─── Auth Checkbox ─── */
.auth-field--checkbox {
  flex-direction: row;
  align-items: center;
  margin: -4px 0 2px;
}
.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  padding: 4px 0;
}
.auth-checkbox input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.auth-checkbox__mark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--input-border, #d1d5db);
  border-radius: 4px;
  background: var(--input-bg, #f9fafb);
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s;
}
.auth-checkbox input:checked + .auth-checkbox__mark {
  background: var(--accent, #6c5ce7);
  border-color: var(--accent, #6c5ce7);
}
.auth-checkbox input:checked + .auth-checkbox__mark::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 6px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.auth-checkbox__label {
  font-size: 0.78rem;
  color: var(--text-secondary, #64748b);
}
.auth-checkbox:hover .auth-checkbox__mark {
  border-color: var(--accent, #6c5ce7);
}

/* ─── Button ─── */
.auth-btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
.auth-btn--primary {
  background: linear-gradient(135deg, var(--accent), #a29bfe);
  color: #fff;
}
.auth-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(108,92,231,0.4);
}
.auth-btn--primary:active { transform: translateY(0); }
.auth-btn--primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ─── Links ─── */
.auth-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
.auth-link {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}
.auth-link strong { color: var(--accent); }
.auth-link:hover { color: var(--text); }
.auth-link--muted { font-size: 0.73rem; color: var(--text-muted); }
.auth-footer-link {
  text-align: center;
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--text-muted, rgba(255,255,255,0.4));
}
.auth-footer-link a {
  color: var(--accent, #6c5ce7);
  text-decoration: none;
  font-weight: 500;
}
.auth-footer-link a:hover { text-decoration: underline; }

/* ── Mobile responsive ── */
@media (max-width: 480px) {
  body {
    padding: 0;
    align-items: flex-start;
  }
  .auth-container {
    max-width: 100%;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 20px;
  }
  .auth-card {
    padding: 24px 20px;
    border-radius: 16px;
  }
  .auth-btn--primary {
    height: 48px;
    font-size: 1rem;
  }
  .auth-field__input {
    font-size: 16px;
    height: 48px;
  }
  .auth-brand {
    margin-bottom: 24px;
  }
  .auth-brand__icon {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }
  .bg-orb-1 { width: 300px; height: 300px; top: -15%; }
  .bg-orb-2 { width: 250px; height: 250px; }
}

/* ── Tablet responsive (TS-36 — auth-row side-by-side) ── */
@media (min-width: 768px) and (max-width: 1024px) {
  body {
    padding: 0 20px;
    align-items: center;
    justify-content: center;
  }
  .auth-container {
    max-width: 520px;
  }
  .auth-card {
    padding: 36px 32px 28px;
  }
  .auth-row {
    flex-direction: row;
  }
  .auth-row > .auth-field {
    flex: 1;
    min-width: 0;
  }
  .auth-brand {
    margin-bottom: 28px;
  }
  .auth-brand__icon {
    width: 60px;
    height: 60px;
    font-size: 1.6rem;
    border-radius: 18px;
    margin-bottom: 14px;
  }
  .auth-brand__title {
    font-size: 1.5rem;
  }
}

/* ── Desktop responsive ── */
@media (min-width: 1025px) {
  body {
    padding: 0 20px;
    align-items: center;
    justify-content: center;
  }
  .auth-container {
    max-width: 560px;
  }
  .auth-card {
    padding: 40px 36px 32px;
    border-radius: calc(var(--radius) + 2px);
  }
  .auth-brand {
    margin-bottom: 32px;
  }
  .auth-brand__icon {
    width: 64px;
    height: 64px;
    font-size: 1.7rem;
    border-radius: 20px;
    margin-bottom: 16px;
    box-shadow: 0 0 50px var(--accent-glow);
  }
  .auth-brand__title {
    font-size: 1.6rem;
  }
  .auth-brand__sub {
    font-size: 0.88rem;
  }
}

/* ── Confirm popup (TS-36 register) ── */
.sic-confirm-popup {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  max-width: 380px;
  width: calc(100% - 48px);
  padding: 28px 24px 20px;
  border-radius: 16px;
  background: var(--card-bg, #fff);
  color: var(--text, #1a1a2e);
  text-align: center;
  z-index: 99999;
  box-shadow: 0 16px 48px rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
.sic-confirm-popup.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}
.sic-confirm-popup__icon {
  font-size: 2.6rem;
  margin-bottom: 12px;
  color: var(--accent, #6c5ce7);
}
.sic-confirm-popup__msg {
  font-size: 0.9rem;
  line-height: 1.45;
  margin-bottom: 6px;
  color: var(--text-secondary, #64748b);
}
.sic-confirm-popup__msg strong {
  color: var(--accent, #6c5ce7);
  font-weight: 700;
}
.sic-confirm-popup__question {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text, #1a1a2e);
}
.sic-confirm-popup__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.sic-confirm-popup__btn {
  flex: 1;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.sic-confirm-popup__btn--cancel {
  background: var(--input-bg, #f1f3f5);
  color: var(--text-secondary, #64748b);
}
.sic-confirm-popup__btn--cancel:hover {
  background: var(--border, #e2e8f0);
}
.sic-confirm-popup__btn--confirm {
  background: linear-gradient(135deg, var(--accent, #6c5ce7), #a29bfe);
  color: #fff;
}
.sic-confirm-popup__btn--confirm:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108,92,231,0.35);
}
.sic-popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99998;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.sic-popup-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}