/* ============================================
   AUYL JASTARY 2026 — MAIN CSS
   Brand colors & global styles
   ============================================ */

/* Fonts: loaded via <link> in layouts/app.blade.php (Inter + Manrope, Bunny Fonts).
   Body uses Inter (Kazakh Cyrillic-tuned), display uses Manrope. */

/* CSS Variables */
:root {
  /* Brand Colors */
  --green-primary: #71B62C;
  --green-dark: #003D12;
  --green-bright: #4EAC01;
  --cream: #FAFCF6;
  --white: #FFFFFF;
  --black: #000000;

  /* Semantic */
  --bg: var(--cream);
  --text: var(--green-dark);
  --text-soft: rgba(0, 61, 18, 0.7);
  --text-muted: rgba(0, 61, 18, 0.5);
  --border: rgba(0, 61, 18, 0.12);
  --border-strong: rgba(0, 61, 18, 0.25);

  /* Typography (overridden in overrides.css with full fallback chain) */
  --font-display: 'Manrope', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Spacing */
  --container: 1200px;
  --gutter: 24px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-xl: 36px;

  /* Shadow */
  --shadow-sm: 0 2px 8px rgba(0, 61, 18, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 61, 18, 0.10);
  --shadow-lg: 0 20px 50px rgba(0, 61, 18, 0.15);

  /* Transitions */
  --t-fast: 150ms ease;
  --t-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-fast);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

ul, ol { list-style: none; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--green-dark);
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.container-narrow {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 252, 246, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter);
  max-width: var(--container);
  margin: 0 auto;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--green-dark);
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--green-primary);
  color: var(--white);
  border-radius: 50%;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand-text small {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--green-primary);
  margin-top: 4px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  position: relative;
}

.nav-links a:hover {
  color: var(--green-primary);
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--green-primary);
  transition: width var(--t-base);
}

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

/* Language switcher */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.lang-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  border-radius: 999px;
  transition: all var(--t-fast);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lang-btn.active {
  background: var(--green-dark);
  color: var(--white);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  position: relative;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
}

.menu-toggle span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 2px;
  background: var(--green-dark);
  transition: all var(--t-base);
}
.menu-toggle span:nth-child(1) { transform: translate(-50%, calc(-50% - 5px)); }
.menu-toggle span:nth-child(3) { transform: translate(-50%, calc(-50% + 5px)); }

.menu-toggle.open span:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translate(-50%, -50%) rotate(-45deg); }

/* ============================================
   USER CHIP (auth-aware navbar)
   ============================================ */
.user-chip {
  position: relative;
  display: inline-flex;
}

.user-chip-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  color: var(--green-dark);
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out, transform 150ms ease-out;
}
.user-chip-trigger:hover {
  border-color: var(--green-primary);
  box-shadow: 0 4px 12px -4px rgba(0, 61, 18, 0.12);
}
.user-chip-trigger:active { transform: scale(0.98); }
.user-chip[data-open="true"] .user-chip-trigger {
  border-color: var(--green-primary);
  background: var(--cream);
}

.user-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--green-bright), var(--green-primary));
  display: grid;
  place-items: center;
  color: var(--white);
}
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.user-avatar-initial {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-family: var(--font-display);
}

.user-chip-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--green-dark);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip-caret {
  color: var(--text-muted);
  transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
.user-chip[data-open="true"] .user-chip-caret { transform: rotate(180deg); }

/* Dropdown menu — origin-aware (top-right anchored) */
.user-chip-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 40px -12px rgba(0, 61, 18, 0.22), 0 4px 12px -4px rgba(0, 61, 18, 0.08);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transform-origin: top right;
  transform: scale(0.96);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    transform 180ms cubic-bezier(0.23, 1, 0.32, 1),
    opacity 150ms ease-out,
    visibility 0s linear 180ms;
  z-index: 100;
}
.user-chip[data-open="true"] .user-chip-menu {
  transform: scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.user-chip-menu a,
.user-chip-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--green-dark);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 130ms ease-out;
}
.user-chip-menu a:hover,
.user-chip-menu button:hover { background: var(--cream); }
.user-chip-menu form { margin: 0; }

@media (max-width: 768px) {
  .user-chip-name { display: none; }
  .user-chip-trigger { padding: 4px; }
  .user-chip-trigger .user-chip-caret { display: none; }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  transition: all var(--t-base);
  white-space: nowrap;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--green-primary);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--green-bright);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-dark {
  background: var(--green-dark);
  color: var(--white);
}
.btn-dark:hover {
  background: #002408;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--green-dark);
  border-color: var(--green-dark);
}
.btn-outline:hover {
  background: var(--green-dark);
  color: var(--white);
}

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

.btn-sm { padding: 10px 18px; font-size: 13px; }
.btn-lg { padding: 18px 36px; font-size: 16px; }
.btn-block { width: 100%; }

/* ============================================
   FORM ELEMENTS (shared)
   ============================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--green-dark);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-label .required {
  color: var(--green-bright);
}

.field-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  color: var(--text);
  transition: all var(--t-fast);
  font-family: var(--font-body);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--border-strong);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--green-primary);
  box-shadow: 0 0 0 4px rgba(113, 182, 44, 0.15);
}

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

.textarea { min-height: 100px; resize: vertical; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8' fill='none'><path d='M1 1L7 7L13 1' stroke='%23003D12' stroke-width='2' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
  cursor: pointer;
}

/* File input */
.file-input {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 20px;
  background: var(--white);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--t-fast);
  text-align: center;
}
.file-input:hover {
  border-color: var(--green-primary);
  background: rgba(113, 182, 44, 0.04);
}
.file-input input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.file-input-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: rgba(113, 182, 44, 0.12);
  color: var(--green-primary);
  border-radius: 50%;
}
.file-input-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--green-dark);
}
.file-input-hint {
  font-size: 12px;
  color: var(--text-muted);
}
.file-input.has-file {
  border-style: solid;
  border-color: var(--green-primary);
  background: rgba(113, 182, 44, 0.06);
}

/* Checkbox */
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  padding: 12px 0;
}

.checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-mark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 2px solid var(--border-strong);
  border-radius: 6px;
  background: var(--white);
  display: grid;
  place-items: center;
  transition: all var(--t-fast);
}
.checkbox-mark::after {
  content: '';
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
  transform: rotate(-45deg) translate(1px, -1px) scale(0);
  transition: transform var(--t-fast);
}
.checkbox input:checked + .checkbox-mark {
  background: var(--green-primary);
  border-color: var(--green-primary);
}
.checkbox input:checked + .checkbox-mark::after {
  transform: rotate(-45deg) translate(1px, -1px) scale(1);
}
.checkbox-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

/* Radio */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.radio {
  position: relative;
  cursor: pointer;
}
.radio input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: all var(--t-fast);
}
.radio:hover .radio-label {
  border-color: var(--green-primary);
  color: var(--green-primary);
}
.radio input:checked + .radio-label {
  background: var(--green-dark);
  color: var(--white);
  border-color: var(--green-dark);
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--green-dark);
  color: var(--white);
  padding: 64px 0 32px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 320px;
}

.footer-brand .brand {
  color: var(--white);
}
.footer-brand .brand-mark {
  background: var(--green-primary);
}
.footer-brand p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

.footer-col h4 {
  color: var(--white);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-weight: 700;
}

.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}
.footer-col a:hover { color: var(--green-primary); }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.socials { display: flex; gap: 10px; }
.socials a {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  transition: all var(--t-fast);
}
.socials a:hover {
  background: var(--green-primary);
  transform: translateY(-2px);
}

/* ============================================
   ALERTS / NOTICES
   ============================================ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success {
  background: rgba(113, 182, 44, 0.12);
  color: var(--green-dark);
  border: 1px solid rgba(113, 182, 44, 0.3);
}
.alert-error {
  background: rgba(220, 50, 50, 0.08);
  color: #b32d2d;
  border: 1px solid rgba(220, 50, 50, 0.2);
}
.alert-info {
  background: var(--white);
  color: var(--green-dark);
  border: 1px solid var(--border);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 999px;
  background: rgba(113, 182, 44, 0.15);
  color: var(--green-primary);
}
.badge-dark {
  background: var(--green-dark);
  color: var(--white);
}

/* ============================================
   UTILS
   ============================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Section spacing */
.section {
  padding: 80px 0;
}
.section-tight {
  padding: 48px 0;
}

/* Section title */
.section-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 48px;
  max-width: 720px;
}
.section-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green-primary);
}
.section-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 900;
  font-family: var(--font-display);
  line-height: 1;
  letter-spacing: -0.025em;
}
.section-desc {
  font-size: 17px;
  color: var(--text-soft);
  max-width: 600px;
  line-height: 1.6;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 960px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  :root { --gutter: 18px; }
  body { font-size: 15px; }

  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--white);
    padding: 24px var(--gutter);
    border-bottom: 1px solid var(--border);
    gap: 18px;
    box-shadow: var(--shadow-md);
    z-index: 99;
  }
  .nav-links.open a {
    padding: 8px 0;
    font-size: 16px;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open a:last-child { border: none; }

  .menu-toggle { display: block; }

  .section { padding: 56px 0; }
  .section-head { margin-bottom: 32px; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer-bottom {
    justify-content: center;
    text-align: center;
  }

  .card { padding: 22px; }
  .grid-2 { grid-template-columns: 1fr; }

  .btn { padding: 12px 22px; font-size: 14px; }
  .btn-lg { padding: 16px 28px; font-size: 15px; }

  .brand-text small { display: none; }
}

@media (max-width: 480px) {
  .brand { font-size: 16px; }
  .brand-mark { width: 34px; height: 34px; }
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
