/* ===== COSTA INDUSTRIES - MAIN STYLESHEET ===== */

/* ===== CSS VARIABLES (Design Tokens) ===== */
:root {
  /* Colors - Light Theme */
  --bg-primary: #fafbfc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f5f6f7;

  --text-primary: #1a1d23;
  --text-secondary: #4a5568;
  --text-tertiary: #5a6474; /* WCAG AA: contrasto ≥4.5:1 su #fafbfc */

  --accent-primary: #c1a57b;
  --accent-secondary: #8b7355;
  --accent-border: #e2d5c5;

  --divider: #e8eaed;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.16);

  /* Typography */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 6rem;
  --space-16: 8rem;

  /* Animations */
  --ease-elegant: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
  --duration-fast: 200ms;
  --duration-medium: 300ms;
  --duration-slow: 400ms;
}

/* Dark Theme */
[data-theme='dark'] {
  --bg-primary: #0f1419;
  --bg-secondary: #1a1f28;
  --bg-tertiary: #242933;

  --text-primary: #e8eaed;
  --text-secondary: #a0a8b0;
  --text-tertiary: #6b7280;

  --accent-primary: #d4af6a;
  --accent-secondary: #b8935a;
  --accent-border: #3a3f4a;

  --divider: #2a2f3a;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.6);
}

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

/* ===== SKIP NAVIGATION ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 9999;
  background: var(--accent-primary);
  color: white;
  padding: var(--space-3) var(--space-5);
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  transition: top var(--duration-fast);
}

.skip-link:focus {
  top: 0;
}

/* ===== FOCUS VISIBLE — WCAG 2.4.7 ===== */
:focus-visible {
  outline: 3px solid var(--accent-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

:focus:not(:focus-visible) {
  outline: none;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0;
  transition:
    background-color var(--duration-slow) var(--ease-elegant),
    color var(--duration-slow) var(--ease-elegant);
}

/* ===== TYPOGRAPHY ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  font-weight: 700;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(2deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* ===== HEADER ===== */
.header {
  background: var(--bg-primary);
  border-bottom: 1px solid rgba(226, 213, 197, 0.3);
  padding: var(--space-4) var(--space-6);
  transition: all var(--duration-slow) var(--ease-elegant);
}

[data-theme='dark'] .header {
  background: rgba(15, 20, 25, 0.85);
  border-bottom: 1px solid rgba(58, 63, 74, 0.5);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: inherit;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: white;
  box-shadow: var(--shadow-md);
  transition: transform var(--duration-medium) var(--ease-elegant);
}

.logo:hover .logo-icon {
  transform: scale(1.05);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-main {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 300;
  letter-spacing: 3px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

/* ===== HAMBURGER BUTTON (mobile) ===== */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  border-radius: 8px;
  transition: background-color var(--duration-fast) var(--ease-elegant);
}

.nav-hamburger:hover {
  background: var(--bg-tertiary);
}

.nav-hamburger .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--duration-medium) var(--ease-elegant), opacity var(--duration-fast);
}

.nav-hamburger[aria-expanded='true'] .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger[aria-expanded='true'] .bar:nth-child(2) {
  opacity: 0;
}

.nav-hamburger[aria-expanded='true'] .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== MOBILE DRAWER ===== */
.nav-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(280px, 85vw);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-xl);
  z-index: 1100;
  padding: var(--space-8) var(--space-6) var(--space-6);
  flex-direction: column;
  gap: var(--space-4);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--duration-medium) var(--ease-elegant);
}

.nav-drawer.open {
  display: flex;
  transform: translateX(0);
}

.nav-drawer-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: var(--text-xl);
  color: var(--text-secondary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-drawer-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-drawer-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  padding-top: var(--space-4);
  border-bottom: 1px solid var(--divider);
  padding-bottom: var(--space-4);
}

.nav-drawer .nav-link {
  font-size: var(--text-base);
  padding: var(--space-3) var(--space-2);
  border-radius: 8px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-drawer .nav-link:hover {
  background: var(--bg-tertiary);
}

.nav-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1099;
  backdrop-filter: blur(2px);
}

.nav-drawer-overlay.open {
  display: block;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: var(--text-sm);
  letter-spacing: 0.5px;
  transition: color var(--duration-fast) var(--ease-elegant);
  position: relative;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  transition: width var(--duration-medium) var(--ease-elegant);
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  padding: var(--space-2) var(--space-5);
  border-radius: 24px;
  font-weight: 600;
}

.nav-link-primary::after {
  display: none;
}

.nav-link-primary:hover {
  color: white;
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.nav-link-login {
  background: transparent;
  border: 2px solid var(--accent-primary);
  color: var(--accent-primary);
  padding: var(--space-2) var(--space-5);
  border-radius: 24px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-link-login::after {
  display: none;
}

.nav-link-login:hover {
  background: var(--accent-primary);
  color: white;
  transform: scale(1.05);
}

.nav-link-profile {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-tertiary);
  padding: var(--space-2) var(--space-4);
  border-radius: 24px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.nav-link-profile::after {
  display: none;
}

.nav-link-profile:hover {
  background: var(--accent-primary);
  color: white;
  transform: scale(1.05);
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  font-size: 1.2rem;
}

/* ===== HERO SECTION ===== */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: var(--space-12) var(--space-6);
}

.hero-content {
  max-width: 1200px;
  text-align: center;
  position: relative;
  z-index: 2;
  animation: fadeInUp 800ms var(--ease-elegant);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: var(--text-6xl);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: var(--space-6);
  color: var(--text-primary);
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: var(--text-xl);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 300;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
}

/* Decorative Floating Cards */
.hero-decoration {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.floating-card {
  position: absolute;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  opacity: 0.05;
  border-radius: 16px;
}

.card-1 {
  width: 300px;
  height: 400px;
  top: 10%;
  left: 5%;
  animation: float 8s ease-in-out infinite;
}

.card-2 {
  width: 200px;
  height: 300px;
  top: 50%;
  right: 10%;
  animation: float 10s ease-in-out infinite 2s;
}

.card-3 {
  width: 250px;
  height: 250px;
  bottom: 10%;
  left: 15%;
  animation: float 12s ease-in-out infinite 4s;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: 24px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all var(--duration-medium) var(--ease-elegant);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
}

.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--divider);
}

.btn-secondary:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: scale(1.05);
}

.btn-large {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}

/* ===== SECTIONS ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

section {
  padding: var(--space-12) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-10);
}

.section-label {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: var(--space-3);
}

.section-title {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--text-primary);
}

/* ===== ABOUT SECTION ===== */
.about {
  background: var(--bg-secondary);
}

.about-text {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  text-align: center;
  max-width: 800px;
  margin: 0 auto var(--space-10);
  line-height: 1.8;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-6);
}

.feature-card {
  background: var(--bg-primary);
  padding: var(--space-6);
  border-radius: 12px;
  border: 1px solid var(--divider);
  text-align: center;
  transition: all var(--duration-medium) var(--ease-elegant);
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-primary);
}

.feature-icon {
  font-size: var(--text-5xl);
  margin-bottom: var(--space-4);
}

.feature-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}

.feature-description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== CTA SECTION ===== */
.cta-section {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
}

.cta-content {
  text-align: center;
  padding: var(--space-10) 0;
}

.cta-title {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
  color: white;
}

.cta-subtitle {
  font-size: var(--text-xl);
  margin-bottom: var(--space-8);
  opacity: 0.9;
  font-weight: 300;
}

.cta-section .btn-primary {
  background: white;
  color: var(--accent-primary);
}

.cta-section .btn-primary:hover {
  background: var(--bg-primary);
}

.cta-section .btn-secondary {
  background: transparent;
  color: white;
  border-color: rgba(255, 255, 255, 0.6);
}

.cta-section .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-color: white;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--divider);
  padding: var(--space-10) 0 var(--space-6);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
  gap: var(--space-6);
}

.footer-brand .logo {
  margin-bottom: var(--space-3);
}

.footer-tagline {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  font-style: italic;
}

.footer-links {
  display: flex;
  gap: var(--space-6);
}

.footer-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--duration-fast) var(--ease-elegant);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer-link:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--space-6);
  border-top: 1px solid var(--divider);
}

.footer-bottom p {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-bottom: var(--space-2);
}

.footer-author {
  font-weight: 600;
  color: var(--text-secondary);
}

/* ===== ICONS ===== */
.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .hero-title {
    font-size: var(--text-5xl);
  }

  .section-title {
    font-size: var(--text-3xl);
  }
}

@media (max-width: 768px) {
  .header {
    padding: var(--space-3) var(--space-4);
  }

  .header-content {
    flex-wrap: nowrap;
    gap: var(--space-2);
  }

  /* Show hamburger button on mobile */
  .nav-hamburger {
    display: flex;
  }

  .nav {
    flex-wrap: nowrap;
    gap: var(--space-2);
    justify-content: flex-end;
    align-items: center;
  }

  /* Only show CTA and profile/login in main nav on mobile — rest in drawer */
  .nav .nav-link:not(.nav-link-primary):not(.nav-link-profile):not(.nav-link-login) {
    display: none;
  }

  /* Hide username in profile link — keep only avatar icon */
  #userName {
    display: none;
  }

  .hero {
    min-height: 70vh;
    padding: var(--space-8) var(--space-4);
  }

  .hero-title {
    font-size: var(--text-4xl);
  }

  .hero-subtitle {
    font-size: var(--text-lg);
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
    gap: var(--space-3);
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: var(--text-3xl);
  }

  .section-title {
    font-size: var(--text-2xl);
  }

  .cta-title {
    font-size: var(--text-3xl);
  }
}

/* ===== PREFERS REDUCED MOTION — WCAG 2.3.3 ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
