/* ==========================================================================
   AUTH GATE & TELEMETRIA - PORTAL IN-FOTON EDUCAÇÃO / LABTEL / UFES
   Estilos visuais do modal de cadastro, login, soft-gate e perfil de usuário.
   ========================================================================== */

:root {
  --auth-primary: #0284C7;
  --auth-primary-dark: #0369A1;
  --auth-accent: #10B981;
  --auth-bg-overlay: rgba(15, 23, 42, 0.75);
  --auth-card-bg: #FFFFFF;
  --auth-border: #E2E8F0;
  --auth-text-main: #0F172A;
  --auth-text-muted: #64748B;
  --auth-radius: 12px;
}

/* --------------------------------------------------------------------------
   BARRA DE STATUS DO USUÁRIO NO HEADER
   -------------------------------------------------------------------------- */
.auth-user-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.25);
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  color: var(--auth-text-main);
  transition: all 0.2s ease;
}

.auth-user-bar.logged-in {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #065F46;
}

.auth-user-bar .auth-btn-action {
  background: transparent;
  border: none;
  color: var(--auth-primary);
  font-weight: 600;
  cursor: pointer;
  padding: 0 0.25rem;
  font-size: 0.85rem;
  text-decoration: underline;
}

.auth-user-bar .auth-btn-action:hover {
  color: var(--auth-primary-dark);
}

.auth-user-avatar {
  width: 22px;
  height: 22px;
  background: var(--auth-primary);
  color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   MODAL OVERLAY & CONTAINER
   -------------------------------------------------------------------------- */
.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--auth-bg-overlay);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 1rem;
}

.auth-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.auth-modal-card {
  background: var(--auth-card-bg);
  border-radius: var(--auth-radius);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--auth-border);
}

.auth-modal-overlay.active .auth-modal-card {
  transform: translateY(0) scale(1);
}

/* CABEÇALHO DO MODAL */
.auth-modal-header {
  padding: 1.5rem 1.75rem 1rem;
  border-bottom: 1px solid var(--auth-border);
  position: relative;
}

.auth-modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: #F1F5F9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--auth-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.auth-modal-close:hover {
  background: #E2E8F0;
  color: var(--auth-text-main);
}

.auth-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #EFF6FF;
  color: var(--auth-primary-dark);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  margin-bottom: 0.5rem;
}

.auth-modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--auth-text-main);
  margin-bottom: 0.25rem;
}

.auth-modal-subtitle {
  font-size: 0.88rem;
  color: var(--auth-text-muted);
  line-height: 1.5;
}

/* ABAS (CADASTRO VS LOGIN) */
.auth-tabs {
  display: flex;
  padding: 0 1.75rem;
  border-bottom: 1px solid var(--auth-border);
  background: #F8FAFC;
}

.auth-tab-btn {
  flex: 1;
  padding: 0.85rem 0.5rem;
  background: transparent;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--auth-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  text-align: center;
}

.auth-tab-btn.active {
  color: var(--auth-primary);
  border-bottom-color: var(--auth-primary);
  background: white;
}

/* CORPO DO FORMULÁRIO */
.auth-modal-body {
  padding: 1.5rem 1.75rem;
}

.auth-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.auth-form-grid .full-width {
  grid-column: span 2;
}

.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.auth-form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}

.auth-form-group input,
.auth-form-group select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--auth-border);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--auth-text-main);
  background: #FFFFFF;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-form-group input:focus,
.auth-form-group select:focus {
  outline: none;
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.auth-form-hint {
  font-size: 0.75rem;
  color: var(--auth-text-muted);
  margin-top: 0.15rem;
}

/* MENSAGENS DE ALERTA */
.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
  line-height: 1.4;
}

.auth-alert.error {
  display: block;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}

.auth-alert.success {
  display: block;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
}

/* BOTÃO PRINCIPAL DE SUBMISSÃO */
.auth-submit-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--auth-primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.auth-submit-btn:hover {
  background: var(--auth-primary-dark);
}

.auth-submit-btn:active {
  transform: scale(0.99);
}

.auth-footer-notice {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--auth-border);
  font-size: 0.75rem;
  color: var(--auth-text-muted);
  text-align: center;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   SOFT-GATE BANNER / NOTA INFORMATIVA NA PÁGINA
   -------------------------------------------------------------------------- */
.softgate-notice-bar {
  background: linear-gradient(135deg, #0369A1, #0284C7);
  color: white;
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  flex-wrap: wrap;
}

.softgate-notice-bar.hidden {
  display: none !important;
}

.softgate-notice-text {
  font-size: 0.9rem;
  line-height: 1.4;
}

.softgate-notice-btn {
  background: #FFFFFF;
  color: var(--auth-primary-dark);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.1s;
}

.softgate-notice-btn:hover {
  background: #F0FDF4;
  color: #15803D;
}

/* Responsividade Mobile */
@media (max-width: 540px) {
  .auth-form-grid {
    grid-template-columns: 1fr;
  }
  .auth-form-grid .full-width {
    grid-column: span 1;
  }
}
