* {
  box-sizing: border-box;
}

:root {
  --bg-gradient-start: #6366f1;
  --bg-gradient-end: #a855f7;
  --card-bg: #ffffff;
  --text-main: #1e1b2e;
  --text-muted: #6b7280;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --secondary: #1e1b2e;
  --secondary-hover: #0f0d1a;
  --border: #e5e7eb;
  --error: #dc2626;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Poppins", system-ui, sans-serif;
  color: var(--text-main);
  background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
  display: flex;
}

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  gap: 20px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  padding: 36px 28px;
  text-align: center;
}

.card-header .logo {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 8px;
}

.card-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
}

.subtitle {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 14px;
}

.qr-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qr-form input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.qr-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  background: #c7c9f5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}

.btn-secondary:hover {
  background: var(--secondary-hover);
}

.form-error {
  margin: 12px 0 0;
  color: var(--error);
  font-size: 13px;
}

.preview {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.preview[hidden] {
  display: none;
}

.qrcode-box {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  display: inline-flex;
}

.qrcode-box img,
.qrcode-box canvas {
  display: block;
  border-radius: 8px;
}

.page-footer {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Modal de anúncio */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 13, 26, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--card-bg);
  border-radius: 20px;
  padding: 32px 24px 28px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  background: transparent;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 20px;
}

.ad-slot {
  min-height: 100px;
  margin-bottom: 20px;
  border-radius: 14px;
  overflow: hidden;
  background: #f9fafb;
}

.countdown-text {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--text-muted);
}

#countdown {
  font-weight: 700;
  color: var(--primary);
}

@media (max-width: 420px) {
  .card {
    padding: 28px 20px;
  }
}
