*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg1: #0f172a;
  --bg2: #020617;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.25);
  --text-primary: #e5e7eb;
  --text-muted: #9ca3af;
  --danger: #f97373;
  --success: #22c55e;
  --radius-xl: 26px;
  --glass: rgba(15, 23, 42, 0.58);
  --shadow-soft: 0 24px 60px rgba(15, 23, 42, 0.65);
  --blur-strength: 24px;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at 0% 0%, #1e293b 0, #020617 50%, #000 100%);
  color: var(--text-primary);
  overflow: hidden;
}

/* Fondo con spots suaves */
.bg-gradient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.15), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(244, 114, 182, 0.12), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(52, 211, 153, 0.12), transparent 55%);
  opacity: 0.8;
  z-index: -1;
}

.container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

/* Tarjeta glassmorphic */
.glass-card {
  width: 100%;
  max-width: 520px;
  padding: 28px 26px 24px;
  border-radius: var(--radius-xl);
  background: linear-gradient(
      135deg,
      rgba(148, 163, 184, 0.16),
      rgba(15, 23, 42, 0.78)
    );
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(var(--blur-strength));
  -webkit-backdrop-filter: blur(var(--blur-strength));
  position: relative;
  overflow: hidden;
}

/* Halo soft UI */
.glass-card::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: radial-gradient(
    circle at top left,
    rgba(56, 189, 248, 0.2),
    transparent 60%
  );
  opacity: 0.45;
  z-index: -1;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

/* New: Logo Image Style */
.logo-img {
  width: 52px; /* Slightly larger for the image */
  height: 52px;
  border-radius: 14px; /* Soft rounded corners typical for an app icon */
  box-shadow:
    6px 8px 18px rgba(15, 23, 42, 0.75),
    -6px -6px 18px rgba(148, 163, 184, 0.45);
  object-fit: cover;
}

/* Removed .logo-circle */

.header h1 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Mensajes */
.message {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
  border-width: 1px;
  border-style: solid;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity 0.2s ease-out,
    transform 0.2s ease-out;
}

.message.success {
  opacity: 1;
  transform: translateY(0);
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(34, 197, 94, 0.6);
  color: var(--success);
}

.message.error {
  opacity: 1;
  transform: translateY(0);
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.75);
  color: var(--danger);
}

.message.hidden {
  display: none;
}

/* Formulario */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px; /* Space before download button */
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-size: 0.85rem;
  font-weight: 500;
}

.field-group small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Input soft + glass */
.input-wrapper {
  position: relative;
  border-radius: 999px;
  padding: 2px;
  background: radial-gradient(
    circle at 0 0,
    rgba(56, 189, 248, 0.6),
    transparent 60%
  );
  opacity: 0.9;
}

.input-wrapper input {
  width: 100%;
  border: none;
  outline: none;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.88rem;
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-primary);
  box-shadow:
    inset 2px 2px 4px rgba(15, 23, 42, 0.9),
    inset -2px -2px 4px rgba(148, 163, 184, 0.35);
}

/* Botones del Formulario */
.row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.btn-primary,
.btn-ghost {
  flex: 1;
  border-radius: 999px;
  padding: 10px 14px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background 0.12s ease,
    color 0.12s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  color: #0f172a;
  box-shadow:
    0 10px 22px rgba(34, 197, 94, 0.35),
    0 12px 26px rgba(14, 165, 233, 0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(34, 197, 94, 0.45),
    0 16px 32px rgba(14, 165, 233, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow:
    0 6px 14px rgba(34, 197, 94, 0.25),
    0 8px 18px rgba(14, 165, 233, 0.3);
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow:
    4px 4px 12px rgba(15, 23, 42, 0.85),
    -4px -4px 12px rgba(148, 163, 184, 0.28);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(15, 23, 42, 0.95);
}

.hint {
  margin-top: 10px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.hint code {
  font-family: monospace;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.hint pre {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px dashed rgba(148, 163, 184, 0.5);
  font-size: 0.7rem;
  line-height: 1.3;
  white-space: pre-line;
}

/* New: Download Button Style */
.row-download {
    margin-top: 16px;
    display: flex; /* Ensures button takes full width in mobile */
}

.btn-download {
    flex-grow: 1; /* Make the link fill the container */
    text-decoration: none;
    text-align: center;
    border-radius: 999px;
    padding: 12px 14px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--bg1); /* Dark text for contrast */
    background: linear-gradient(135deg, #f97373, #facc15); /* Orange/Red gradient */
    box-shadow: 0 10px 22px rgba(255, 107, 107, 0.35), 0 12px 26px rgba(250, 204, 21, 0.4);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-download i {
    margin-right: 8px;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(255, 107, 107, 0.45), 0 16px 32px rgba(250, 204, 21, 0.5);
}

.btn-download:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(255, 107, 107, 0.25), 0 8px 18px rgba(250, 204, 21, 0.3);
}

/* Responsive */
@media (max-width: 600px) {
  .glass-card {
    padding: 22px 18px 18px;
  }

  .header h1 {
    font-size: 1.1rem;
  }

  .row {
    flex-direction: column;
  }
}