/* ============================================
   Viva Sem Medo Deeplink — Design System
   ============================================ */

:root {
  /* ── Brand Colors ── */
  --primary: #009FE1;
  --primary-light: #33B2E7;
  --primary-dark: #0080B8;
  --primary-50: #E6F5FC;

  /* ── Neutrals ── */
  --white: #FFFFFF;
  --gray-50: #F9FAFB;
  --gray-100: #F2F4F7;
  --gray-200: #EAECF0;
  --gray-300: #D0D5DD;
  --gray-500: #667085;
  --gray-800: #1D2939;
  --gray-900: #101828;

  /* ── Accents ── */
  --success: #12B76A;
  --danger: #F04438;

  /* ── Typography ── */
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* ── Borders & Shadows ── */
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(16,24,40,0.1), 0 1px 2px rgba(16,24,40,0.06);
  --shadow-lg: 0 12px 16px -4px rgba(16,24,40,0.08), 0 4px 6px -2px rgba(16,24,40,0.03);

  /* ── Transitions ── */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--gray-900);
  background: var(--white);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ── Layout ── */
.app-layout {
  width: 100%;
  max-width: 480px;
}

.main-content {
  width: 100%;
}

/* ── Cards ── */
.card {
  background: var(--white);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ── Typography Elements ── */
.brand-header {
  margin-bottom: 32px;
}

.brand-logo {
  height: 48px;
  object-fit: contain;
}

.greeting h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.greeting p {
  color: var(--gray-500);
  font-size: 1rem;
  margin-bottom: 32px;
}

/* ── Code Box ── */
.code-section {
  width: 100%;
  margin-bottom: 32px;
  position: relative;
}

.code-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-box {
  background: var(--primary-50);
  border: 2px dashed var(--primary-light);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#invite-code-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: 0.1em;
  flex: 1;
}

.icon-button {
  background: var(--white);
  border: 1px solid var(--primary-light);
  color: var(--primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.icon-button:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.feedback-text {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--success);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.feedback-text.show {
  opacity: 1;
}

/* ── QR Section ── */
.qr-section {
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qr-label {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 12px;
}

.qr-container {
  background: var(--white);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

/* ── Buttons ── */
.action-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  width: 100%;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  cursor: pointer;
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border: none;
  box-shadow: 0 4px 6px -1px rgba(0, 159, 225, 0.2), 0 2px 4px -1px rgba(0, 159, 225, 0.1);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 10px 15px -3px rgba(0, 159, 225, 0.3), 0 4px 6px -2px rgba(0, 159, 225, 0.15);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--white);
  color: var(--gray-800);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

/* ── Error State ── */
.icon-error {
  color: var(--danger);
  margin-bottom: 16px;
}

.error-card h2 {
  font-size: 1.5rem;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.error-card p {
  color: var(--gray-500);
}

.mt-4 {
  margin-top: 24px;
}

/* ── Animations & Feedback ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn {
  animation: fadeIn 0.5s ease forwards;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .card {
    padding: 32px 20px;
  }
}
