@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --border: #e2e8f0;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

/* Container */
.container {
  margin: 48px auto;
  max-width: 1100px;
  padding: 0 24px;
  width: 100%;
}

/* Títulos */
h1, h2, h3 {
  color: var(--text);
  letter-spacing: -0.01em;
}

h2 {
  font-size: 28px;
  margin-bottom: 20px;
  text-align: center;
}

h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

label {
  color: var(--muted);
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"] {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  margin-bottom: 18px;
  padding: 12px 14px;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="file"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

button {
  background: var(--primary);
  border: none;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  margin-top: 10px;
  padding: 12px 16px;
  text-align: center;
  transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease;
  width: 100%;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  border-radius: 12px;
  color: #fff;
  font-weight: 600;
  padding: 12px 16px;
  text-decoration: none;
}

.button:hover {
  background: var(--primary-dark);
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.2);
}

body > div.container > div > table > tbody > tr > td > button {
  font-size: 100% !important;
  height: auto !important;
  margin-bottom: 10px !important;
  margin-top: 10px !important;
  padding: 10px 10px !important;
}

button:hover {
  background: var(--primary-dark);
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

.csrf-token {
  display: none;
}

.register-link {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
}

.register-link a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.register-link a:hover {
  text-decoration: underline;
}

.navbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
}

.navbar a {
  color: var(--text);
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 10px;
}

.navbar a:hover {
  background: #eef2ff;
}

.form-group {
  margin-bottom: 15px;
}

.form-group input,
.form-group select {
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-top: 5px;
  padding: 8px;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.notification {
  border-radius: 12px;
  color: #fff;
  font-weight: 600;
  opacity: 0;
  padding: 14px 18px;
  position: fixed;
  right: 20px;
  top: 20px;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.notification.success {
  background-color: var(--success);
}

.notification.error {
  background-color: var(--danger);
}

.notification.show {
  opacity: 1;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  10% {
    opacity: 1;
    transform: translateY(0);
  }
  90% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Caixa de autenticação 2FA */
.auth-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 auto;
  max-width: 520px;
  padding: 28px;
  text-align: center;
  width: 100%;
}

.auth-box h2 {
  color: #333;
  font-size: 1.5em;
  margin-bottom: 10px;
}

.auth-box p {
  color: #666;
  font-size: 1em;
  margin-bottom: 20px;
}

/* Estilo para o QR Code */
.qr-code-box {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.qr-code-box img {
  border-radius: 8px;
  height: auto;
  max-width: 100%;
}

/* Formulário de autenticação */
.auth-form {
  display: flex;
  flex-direction: column;
}

.auth-form label {
  color: #333;
  font-weight: bold;
  margin-bottom: 5px;
  text-align: left;
}

.input-field {
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
  font-size: 1em;
  margin-bottom: 15px;
  padding: 10px;
}

.input-field:focus {
  border-color: #4caf50;
  box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
  outline: none;
}

/* Formulários */
.form {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 auto 40px;
  max-width: 720px;
  padding: 24px;
}

.form label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
}

.form input[type="text"],
.form input[type="password"] {
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
  margin-bottom: 20px;
  padding: 12px 16px;
  width: 100%;
}

.form input[type="text"]:focus,
.form input[type="password"]:focus {
  border-color: #007bff;
  outline: none;
}

.optional-fields {
  margin-bottom: 20px;
}

#toggleOptionalFields {
  background-color: #6c757d;
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  margin-bottom: 10px;
  padding: 10px 16px;
}

#toggleOptionalFields:hover {
  background-color: #5a6268;
}

/* Botões */
.btn {
  border: none;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 20px;
}

.btn-success {
  background-color: var(--success);
}

.btn-success:hover {
  background-color: #15803d;
}

.btn-primary {
  background-color: var(--primary);
}

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

.btn-secondary {
  background-color: #475569;
}

.btn-secondary:hover {
  background-color: #334155;
}

/* Mensagens */
.success-message {
  color: var(--success);
  margin-bottom: 20px;
  text-align: center;
}

.error-message {
  color: var(--danger);
  margin-bottom: 20px;
  text-align: center;
}

/* Tabela Responsiva */
.table-responsive {
  margin-top: 20px;
  overflow-x: auto;
}

.data-table {
  background-color: var(--surface);
  border-collapse: collapse;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 40px;
  overflow: hidden;
  width: 100%;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  background-color: #f1f5f9;
  color: var(--text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}

.data-table tr:nth-child(even) {
  background-color: #f8fafc;
}

.data-table tr:hover {
  background-color: #eef2ff;
}

.data-table td {
  color: var(--text);
}

.data-table a {
  color: var(--primary);
  text-decoration: none;
  word-break: break-all;
}

.data-table a:hover {
  text-decoration: underline;
}

.data-table button,
.data-table .btn {
  width: auto;
}

.data-table .optional-field {
  color: #888;
  font-style: italic;
}

.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 20px 0;
  padding: 20px;
}

.hero {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 45%, #60a5fa 100%);
  border-radius: 20px;
  color: #fff;
  padding: 36px;
  box-shadow: var(--shadow);
}

.hero h1 {
  font-size: 32px;
  margin-bottom: 8px;
}

.hero p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 20px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #fff;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
}

.password-cell {
  align-items: center;
  display: flex;
  gap: 8px;
}

.copy-password {
  position: relative;
}

.copy-tooltip {
  position: absolute;
  top: -28px;
  right: 0;
  background: #0f172a;
  color: #fff;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}

.copy-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

.masked-password {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  padding: 6px 10px;
  width: 220px;
}

.password-placeholder {
  color: var(--text-soft);
  font-size: 13px;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
}

.inline-field {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-field input {
  flex: 1;
}

/* Ajustes para Dispositivos Móveis */
@media (max-width: 768px) {
  .container {
    padding: 10px;
    width: 100%;
  }

  .navbar {
    flex-direction: column;
    text-align: center;
  }

  .form-group,
  .button {
    margin-top: 10px;
    width: 100%;
  }

  .button {
    padding: 15px;
  }

  .form input[type="text"],
  .form input[type="password"] {
    font-size: 14px;
  }

  .btn {
    font-size: 14px;
  }

  .data-table th,
  .data-table td {
    font-size: 13px;
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 20px;
  }
}

/* Estilo para cada item de código de backup */
ul {
  list-style-type: none;
  padding: 0;
}

ul li {
  background-color: #f9f9f9; /* Fundo claro */
  border: 1px solid #ddd;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Sombra sutil */
  color: #2c3e50; /* Cor do texto */
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 8px;
  padding: 10px 15px;
  text-align: center;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

/* Efeito ao passar o mouse */
ul li:hover {
  background-color: #e1f5fe; /* Fundo azul claro no hover */
  transform: translateY(-2px); /* Eleva levemente o item */
}

/* ===== Novo tema moderno (override) ===== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');
:root {
  --bg: #0b1120;
  --bg-soft: #111827;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --text-soft: #475569;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --accent: #0ea5e9;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  --border: #e2e8f0;
  --shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: #f1f5f9;
  color: var(--text);
}

.app-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--bg);
  color: #fff;
  padding: 18px 0;
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nav-links a {
  color: #e2e8f0;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 12px;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-links a:hover {
  background: rgba(148, 163, 184, 0.2);
  color: #fff;
}

.nav-logout {
  margin: 0;
}

.nav-link-button {
  background: transparent;
  border: 1px solid rgba(226, 232, 240, 0.35);
  color: #e2e8f0;
  padding: 6px 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.nav-link-button:hover {
  background: rgba(148, 163, 184, 0.2);
}

.main {
  flex: 1;
  padding: 40px 0 60px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
}

.container-wide {
  max-width: 100%;
}

.hero {
  background: radial-gradient(circle at top left, #6366f1 0%, #312e81 40%, #0b1120 80%);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 48px;
  display: grid;
  gap: 18px;
  box-shadow: var(--shadow);
}

.hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.02em;
}

.hero p {
  color: #e2e8f0;
  max-width: 680px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.section-title {
  font-size: 22px;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.btn,
button {
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
}

button:hover,
.btn:hover {
  background: var(--primary-dark);
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.25);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #0f172a;
}

.btn-secondary:hover {
  background: #111827;
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(226, 232, 240, 0.6);
}

.btn-outline:hover {
  background: rgba(226, 232, 240, 0.15);
}

.btn-light {
  background: #fff;
  color: #0f172a;
}

.btn-light:hover {
  background: #e2e8f0;
}

.footer {
  background: var(--bg);
  color: #e2e8f0;
  padding: 28px 0;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 24px;
}

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  width: min(720px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.modal ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.actions-col {
  text-align: right;
  width: 140px;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.meta-container {
  display: grid;
  gap: 10px;
  margin: 10px 0;
}

.meta-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 10px;
  align-items: center;
}

.meta-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--text-soft);
}

.text-muted {
  color: var(--text-soft);
}

@media (max-width: 768px) {
  .topbar-inner,
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    padding: 32px;
  }
}