:root {
  --ink: #f1f3f6;
  --muted: #c5c9d2;
  --paper: #111216;
  --accent: #f08a24;
  --accent-dark: #c46814;
  --card: #2a2f37;
  --line: #3b414c;
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
  --glow: 0 0 0 1px rgba(240, 138, 36, 0.18), 0 12px 26px rgba(240, 138, 36, 0.2);
}

html {
  font-size: 15px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 80px;
  color: var(--ink);
  font-family: "Candara", "Segoe UI", "Tahoma", sans-serif;
  background: linear-gradient(rgba(15, 16, 20, 0.72), rgba(15, 16, 20, 0.72)),
    url("/images/foto_1.jpg") center/cover no-repeat fixed;
}

.app-navbar {
  background: #1b1f26;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.brand-text {
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.logo-mark {
  width: 56px;
  height: 32px;
  object-fit: contain;
}

.app-main {
  padding-top: 24px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  background: var(--card);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(240, 138, 36, 0.6);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.card-header {
  background: #313640;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 600;
  box-shadow: 0 12px 24px rgba(240, 138, 36, 0.2);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: var(--glow);
}

.btn-outline-secondary {
  border-radius: 999px;
  padding: 10px 20px;
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
}

.footer {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  background: rgba(17, 18, 22, 0.9);
}

.login-page {
  background: linear-gradient(rgba(15, 16, 20, 0.6), rgba(15, 16, 20, 0.6)),
    url("/images/foto_1.jpg") center/cover no-repeat fixed;
}

.login-hero {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(420px, 92vw);
  background: rgba(27, 31, 38, 0.94);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 28px 32px;
  box-shadow: var(--shadow);
  animation: floatIn 0.6s ease forwards;
}

.form-control,
.form-select {
  background: #2f3540;
  border: 1px solid #3f4653;
  color: var(--ink);
  border-radius: 14px;
  padding: 10px 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(240, 138, 36, 0.8);
  box-shadow: 0 0 0 0.2rem rgba(240, 138, 36, 0.2);
}

.form-control::placeholder,
.form-select::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.form-label {
  color: #e6e9ef;
  font-weight: 600;
}

.app-navbar .nav-link,
.app-navbar .navbar-text,
.app-navbar .navbar-brand {
  color: #f1f3f6 !important;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus {
  color: #ffd7a6 !important;
}

.session-countdown {
  font-weight: 600;
  color: #ffe6c7;
  background: rgba(240, 138, 36, 0.18);
  border: 1px solid rgba(240, 138, 36, 0.35);
  border-radius: 999px;
  padding: 4px 10px;
}

.app-toast {
  color: var(--ink);
  border: 1px solid rgba(240, 138, 36, 0.35);
  box-shadow: var(--shadow);
  border-radius: 12px;
}

.app-toast-success {
  background: #1f3a2a;
  border-color: rgba(86, 214, 140, 0.6);
}

.app-toast-error {
  background: #3a1f1f;
  border-color: rgba(236, 88, 88, 0.7);
}

.app-toast .toast-body {
  font-weight: 600;
}

.progress-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 18px;
}

.progress-strip span {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.progress-complete span {
  background: rgba(86, 214, 140, 0.16);
  border-color: rgba(86, 214, 140, 0.5);
  color: #eaffea;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.section-grid > .card {
  margin-bottom: 0;
}

.section-grid .card-header::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  display: inline-block;
  margin-right: 8px;
  box-shadow: 0 0 10px rgba(240, 138, 36, 0.6);
}

.actions-bar {
  grid-column: 1 / -1;
  position: sticky;
  bottom: 16px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  background: rgba(27, 31, 38, 0.94);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  z-index: 10;
}

.actions-left,
.actions-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.report-btn {
  border-radius: 999px;
  font-weight: 700;
  padding: 10px 18px;
  box-shadow: 0 10px 22px rgba(200, 60, 60, 0.25);
}

.modal-content {
  background: #1f242c;
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.modal-header {
  border-bottom: 1px solid var(--line);
  background: #2a2f37;
}

.modal-title {
  font-weight: 700;
  color: #f1f3f6;
}

.modal-body .form-label {
  color: #e6e9ef;
}

.preview-card {
  border-color: rgba(240, 138, 36, 0.55);
  box-shadow: 0 18px 40px rgba(240, 138, 36, 0.18);
  background: linear-gradient(180deg, rgba(42, 47, 55, 0.98), rgba(36, 40, 48, 0.98));
}

.preview-note {
  background: rgba(240, 138, 36, 0.12);
  border-color: rgba(240, 138, 36, 0.35);
  color: #ffe7c5;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1050;
}

.loading-overlay.show {
  display: flex;
}

.loading-card {
  background: #2a2f37;
  border: 1px solid #3b414c;
  border-radius: 16px;
  padding: 24px 28px;
  text-align: center;
  box-shadow: var(--shadow);
  color: var(--ink);
}

.generate-btn {
  position: relative;
}

.generate-ready {
  color: #eaffea;
  border-color: rgba(86, 214, 140, 0.6);
  box-shadow: 0 0 0 1px rgba(86, 214, 140, 0.3);
  animation: greenPulse 1.8s ease-in-out infinite;
  background: rgba(86, 214, 140, 0.08);
}

.generate-ready:hover,
.generate-ready:focus {
  color: #ffffff;
  border-color: rgba(86, 214, 140, 0.9);
  box-shadow: 0 0 0 2px rgba(86, 214, 140, 0.4), 0 14px 28px rgba(0, 0, 0, 0.25);
}

.generate-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  animation: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.8);
}

@keyframes greenPulse {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(86, 214, 140, 0.25), 0 0 0 0 rgba(86, 214, 140, 0.35);
    background: rgba(86, 214, 140, 0.06);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(86, 214, 140, 0.5), 0 0 12px 4px rgba(86, 214, 140, 0.25);
    background: rgba(86, 214, 140, 0.18);
  }
}

.reveal-card {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.reveal-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .login-card {
    animation: none;
    opacity: 1;
  }

  .reveal-card {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.login-title {
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-size: 1.4rem;
  font-weight: 700;
}

.login-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 2px solid rgba(240, 138, 36, 0.6);
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35);
}

.login-avatar svg {
  width: 48px;
  height: 48px;
  stroke: #ffd7a6;
  stroke-width: 3;
  fill: none;
}

.login-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}
