/* ==========================================
   PHONA - GLOBAL STYLES & DESIGN TOKENS
   Mantém identidade visual analógica moderna
   ========================================== */

/* ==========================================
   RESET & BASE
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

/* ==========================================
   DESIGN TOKENS
   ========================================== */
:root {
  /* Paleta de cores autoral (Phona Brand) */
  --copper: #c28c66;
  --copper-light: #d4a378;
  --copper-dark: #a67351;
  --peach: #e8b4a0;
  --sage: #8a9a8e;
  --charcoal: #1a1a1a;
  --charcoal-light: #2a2a2a;
  --cream: #f5f1ed;
  --warm-white: #fafaf8;

  /* Sistema de cores aplicado */
  --bg-primary: #0d0d0d;
  --bg-secondary: #161616;
  --bg-card: #1f1f1f;
  --bg-input: #252525;
  --text-primary: #f5f1ed;
  --text-secondary: #a8a29e;
  --text-muted: #6b6763;
  --border: rgba(194, 140, 102, 0.15);
  --border-hover: rgba(194, 140, 102, 0.35);
  --border-focus: rgba(194, 140, 102, 0.55);

  /* Estados */
  --success: #20c978;
  --warning: #ffc13a;
  --error: #ff4d4d;
  --info: var(--copper-light);

  /* Tipografia */
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Escalas de tamanho de fonte */
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 1.875rem;
  --fs-4xl: 2.25rem;
  --fs-5xl: 3rem;

  /* Espaçamento */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Border radius */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Sombras */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 24px rgba(194, 140, 102, 0.25);
  --shadow-xl: 0 12px 32px rgba(194, 140, 102, 0.35);

  /* Transições */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --transition-fast: 150ms var(--ease-smooth);
  --transition-base: 250ms var(--ease-smooth);
  --transition-slow: 400ms var(--ease-smooth);
}

/* ==========================================
   BASE STYLES
   ========================================== */
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ==========================================
   TYPOGRAPHY
   ========================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 {
  font-size: var(--fs-5xl);
}

h2 {
  font-size: var(--fs-4xl);
}

h3 {
  font-size: var(--fs-3xl);
}

h4 {
  font-size: var(--fs-2xl);
}

p {
  margin-bottom: var(--space-sm);
}

a {
  color: var(--copper-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--copper);
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.875rem 1.75rem;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  outline: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--copper) 0%, var(--copper-dark) 100%);
  color: white;
  box-shadow: var(--shadow-lg);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--border-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text-primary);
  background: rgba(194, 140, 102, 0.1);
  border-color: var(--border);
}

.btn-sm {
  padding: 0.625rem 1.25rem;
  font-size: var(--fs-sm);
}

.btn-lg {
  padding: 1.125rem 2.25rem;
  font-size: var(--fs-lg);
}

/* ==========================================
   INPUTS & FORMS
   ========================================== */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  margin-bottom: var(--space-xs);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: all var(--transition-base);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(194, 140, 102, 0.1);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-error {
  margin-top: var(--space-xs);
  font-size: var(--fs-sm);
  color: var(--error);
}

.form-hint {
  margin-top: var(--space-xs);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* ==========================================
   CARDS
   ========================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

.card-header {
  margin-bottom: var(--space-md);
}

.card-title {
  font-size: var(--fs-xl);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.card-description {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

/* ==========================================
   LAYOUT UTILITIES
   ========================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-sm {
  max-width: 640px;
}

.container-md {
  max-width: 768px;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-xs {
  gap: var(--space-xs);
}

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.gap-lg {
  gap: var(--space-lg);
}

.text-center {
  text-align: center;
}

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

.text-secondary {
  color: var(--text-secondary);
}

/* ==========================================
   ALERTS & NOTIFICATIONS
   ========================================== */
.alert {
  padding: var(--space-md);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  margin-bottom: var(--space-md);
}

.alert-success {
  background: rgba(32, 201, 120, 0.1);
  border: 1px solid rgba(32, 201, 120, 0.3);
  color: var(--success);
}

.alert-error {
  background: rgba(255, 77, 77, 0.1);
  border: 1px solid rgba(255, 77, 77, 0.3);
  color: var(--error);
}

.alert-warning {
  background: rgba(255, 193, 58, 0.1);
  border: 1px solid rgba(255, 193, 58, 0.3);
  color: var(--warning);
}

.alert-info {
  background: rgba(194, 140, 102, 0.1);
  border: 1px solid var(--border);
  color: var(--copper-light);
}

/* ==========================================
   LOADING STATES
   ========================================== */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--copper);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.skeleton {
  background: linear-gradient(90deg,
      var(--bg-card) 25%,
      var(--bg-secondary) 50%,
      var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

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

/* Focus visible styles */
:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

/* Large Desktop */
@media (min-width: 1441px) {
  .container {
    max-width: 1400px;
  }
}

/* Desktop */
@media (max-width: 1440px) {
  :root {
    --fs-5xl: 2.75rem;
    --fs-4xl: 2rem;
  }
}

/* Tablet */
@media (max-width: 1024px) {
  :root {
    --fs-5xl: 2.5rem;
    --fs-4xl: 1.875rem;
    --fs-3xl: 1.625rem;
    --space-xl: 2.5rem;
    --space-2xl: 3.5rem;
    --space-3xl: 5rem;
  }

  .container {
    padding: 0 var(--space-md);
  }

  /* Adjust button sizes for better touch targets */
  .btn {
    min-height: 44px;
  }
}

/* Mobile Landscape / Small Tablet */
@media (max-width: 768px) {
  :root {
    --fs-5xl: 2.25rem;
    --fs-4xl: 1.875rem;
    --fs-3xl: 1.5rem;
    --fs-2xl: 1.375rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
  }

  .container {
    padding: 0 var(--space-sm);
  }

  /* Stack flex layouts vertically */
  .flex {
    flex-direction: column;
  }

  /* Full width buttons on mobile */
  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  /* Larger touch targets */
  .btn {
    min-height: 48px;
    padding: 1rem 1.5rem;
  }

  .btn-sm {
    min-height: 44px;
    padding: 0.75rem 1.25rem;
  }

  /* Card adjustments */
  .card {
    padding: var(--space-md);
  }

  /* Form inputs - larger for mobile */
  .form-input,
  .form-select,
  .form-textarea {
    padding: 1rem;
    font-size: 1rem;
    /* Prevent zoom on iOS */
  }
}

/* Mobile Portrait */
@media (max-width: 480px) {
  :root {
    --fs-5xl: 2rem;
    --fs-4xl: 1.625rem;
    --fs-3xl: 1.375rem;
    --fs-2xl: 1.25rem;
    --fs-xl: 1.125rem;
    --space-md: 1.25rem;
    --space-lg: 1.25rem;
    --space-xl: 1.75rem;
    --space-2xl: 2.5rem;
    --space-3xl: 3.5rem;
  }

  .container {
    padding: 0 1rem;
  }

  /* Smaller cards on very small screens */
  .card {
    padding: var(--space-sm);
    border-radius: var(--radius);
  }

  /* Adjust button text size */
  .btn {
    font-size: 0.9375rem;
  }

  /* Compact form groups */
  .form-group {
    margin-bottom: var(--space-sm);
  }
}

/* Small Mobile */
@media (max-width: 320px) {
  :root {
    --fs-5xl: 1.75rem;
    --fs-4xl: 1.5rem;
    --fs-3xl: 1.25rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
  }

  .container {
    padding: 0 0.75rem;
  }

  .btn {
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}