/* ── Horique Design System ─────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Custom Properties ─────────────────────────────────────────── */

:root {
  /* Brand */
  --color-primary:        #1A7A5E;
  --color-primary-hover:  #0F5C46;
  --color-primary-light:  rgba(26, 122, 94, 0.12);
  --color-primary-glow:   rgba(26, 122, 94, 0.25);
  --color-secondary:      #4DBFA0;

  /* Dark backgrounds (Tailcast-inspired) */
  --bg-dark1:             #17181B;
  --bg-dark2:             #1E1F23;
  --bg-dark3:             #28292E;
  --bg-dark3-hover:       #2F3036;
  --bg-dark-transparent:  rgba(23, 24, 27, 0.75);

  /* Light backgrounds (AgenceX-inspired) */
  --bg-light1:            #FFFFFF;
  --bg-light2:            #F8F9FA;
  --bg-light3:            #F1F2F4;
  --bg-light3-hover:      #E8E9EC;

  /* Text - dark mode */
  --text-primary-dark:    #FFFFFF;
  --text-secondary-dark:  #AEB2B7;
  --text-muted-dark:      #6B7280;

  /* Text - light mode */
  --text-primary-light:   #17181B;
  --text-secondary-light: #4B5563;
  --text-muted-light:     #9CA3AF;

  /* Borders */
  --border-subtle:        rgba(255, 255, 255, 0.08);
  --border-default:       rgba(255, 255, 255, 0.12);
  --border-strong:        rgba(255, 255, 255, 0.2);
  --border-light-subtle:  rgba(0, 0, 0, 0.06);
  --border-light-default: rgba(0, 0, 0, 0.10);

  /* Semantic (resolved at runtime) */
  --bg:         var(--bg-dark1);
  --bg2:        var(--bg-dark2);
  --bg3:        var(--bg-dark3);
  --bg3-hover:  var(--bg-dark3-hover);
  --text:       var(--text-primary-dark);
  --text-sec:   var(--text-secondary-dark);
  --text-muted: var(--text-muted-dark);
  --border:     var(--border-default);

  /* Spacing */
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  /* Transitions */
  --transition: all 0.2s ease;
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Light mode overrides ──────────────────────────────────────────── */

:root.light {
  --bg:         var(--bg-light1);
  --bg2:        var(--bg-light2);
  --bg3:        var(--bg-light3);
  --bg3-hover:  var(--bg-light3-hover);
  --text:       var(--text-primary-light);
  --text-sec:   var(--text-secondary-light);
  --text-muted: var(--text-muted-light);
  --border:     var(--border-light-default);
}

/* ── Reset & Base ──────────────────────────────────────────────────── */

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* ── Layout ────────────────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

@media (min-width: 640px)  { .container { padding: 0 2rem; } }
@media (min-width: 1024px) { .container { padding: 0 2.5rem; } }

/* ── Typography ────────────────────────────────────────────────────── */

.section-eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-sec);
  line-height: 1.7;
  max-width: 560px;
}

/* ── Buttons ───────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
  border: 1.5px solid transparent;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0 var(--color-primary-glow);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  box-shadow: 0 0 24px var(--color-primary-glow);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
  background: var(--bg2);
}
.btn-outline:hover {
  background: var(--bg3);
  border-color: var(--border-strong);
}

.btn-sm  { padding: 0.5rem 1rem; font-size: 0.8rem; }
.btn-lg  { padding: 0.9rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ── Cards ─────────────────────────────────────────────────────────── */

.card {
  background: rgba(40, 41, 46, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: var(--transition-slow);
}
.card:hover {
  border-color: var(--border-default);
  background: rgba(43, 44, 50, 0.7);
}
.card-colored:hover {
  border-color: rgba(26, 122, 94, 0.3);
}

:root.light .card {
  background: var(--bg-light1);
  border-color: var(--border-light-subtle);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
:root.light .card:hover {
  box-shadow: 0 4px 24px rgba(0,0,0,0.1);
  border-color: var(--border-light-default);
}

/* ── Form elements ─────────────────────────────────────────────────── */

.form-group { margin-bottom: 1.1rem; }

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-sec);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus { border-color: var(--color-primary); }
.form-input:hover:not(:focus) { border-color: var(--border-strong); }

.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
  appearance: none;
  cursor: pointer;
}
.form-select:focus { border-color: var(--color-primary); }

.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.35rem; }
.form-error { font-size: 0.78rem; color: #EF4444; margin-top: 0.35rem; }

/* ── Alerts ────────────────────────────────────────────────────────── */

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: none;
}
.alert.show { display: block; }
.alert-error   { background: rgba(239,68,68,0.1);  color: #FCA5A5; border: 1px solid rgba(239,68,68,0.2); }
.alert-success { background: rgba(26,122,94,0.12); color: var(--color-secondary); border: 1px solid rgba(26,122,94,0.2); }
.alert-info    { background: rgba(99,102,241,0.1); color: #A5B4FC; border: 1px solid rgba(99,102,241,0.2); }

:root.light .alert-error   { background: #FEF2F2; color: #DC2626; border-color: #FECACA; }
:root.light .alert-success { background: #F0FDF4; color: #15803D; border-color: #BBF7D0; }

/* ── Badge ─────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-primary { background: var(--color-primary-light); color: var(--color-secondary); }
.badge-neutral { background: var(--bg3); color: var(--text-sec); }

/* ── Divider ───────────────────────────────────────────────────────── */

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 1.25rem 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Animations ────────────────────────────────────────────────────── */

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.hero-fade-in {
  opacity: 0;
  animation: heroFadeIn 0.5s ease forwards;
  animation-delay: var(--delay, 0s);
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Spinner ───────────────────────────────────────────────────────── */

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ── Scroll-up button ──────────────────────────────────────────────── */

#scroll-up {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 42px;
  height: 42px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 100;
  box-shadow: 0 4px 16px var(--color-primary-glow);
}
#scroll-up.show { opacity: 1; pointer-events: all; }
#scroll-up:hover { transform: translateY(-2px); }

/* ── Image glow border (Tailcast) ──────────────────────────────────── */

.image-glow {
  position: relative;
  border-radius: var(--radius-lg);
}
.image-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(26,122,94,0.5), transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(26,122,94,0.5), transparent 50%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}
.image-glow::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: var(--radius-lg);
  pointer-events: none;
  z-index: 1;
  background:
    linear-gradient(to right, rgba(26,122,94,0.4), transparent 50%) top / 100% 8px no-repeat,
    linear-gradient(to bottom, rgba(26,122,94,0.4), transparent 50%) left / 8px 100% no-repeat,
    linear-gradient(to left, rgba(26,122,94,0.4), transparent 50%) bottom / 100% 8px no-repeat,
    linear-gradient(to top, rgba(26,122,94,0.4), transparent 50%) right / 8px 100% no-repeat;
  filter: blur(8px);
}

/* ── Shape dividers ────────────────────────────────────────────────── */

.shape-divider {
  width: 100%;
  overflow: hidden;
  line-height: 0;
}
.shape-divider svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 80px;
}
.shape-divider.flip { transform: rotate(180deg); }

/* ── Utilities ─────────────────────────────────────────────────────── */

.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;
}
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-primary-color { color: var(--color-primary); }
.text-secondary-color { color: var(--color-secondary); }
.text-muted { color: var(--text-muted); }
