/* Repartex public site styles, ported from the previous Sass partials. */

:root {
  --bg: #ffffff;
  --bg-alt: #efe8d8;            /* warm parchment, from the original branding */
  --fg: #1f2933;
  --muted: #616e7c;
  --accent: #00675b;           /* Repartex brand green (from logo/favicon) */
  --accent-strong: #00473d;    /* darker green for hover/active */
  --border: #d9dee5;

  --max: 1080px;
  --radius: 8px;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; color: var(--fg); }
h1 { font-size: 2rem; margin: 0 0 .5rem; }
h2 { font-size: 1.6rem; margin: 0 0 .75rem; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section { padding: 3rem 0; }
.section--brands { background: var(--bg-alt); }
.section--message { min-height: 50vh; display: flex; align-items: center; }

.lead { color: var(--muted); font-size: 1.05rem; max-width: 65ch; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: .7rem 1.25rem;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { text-decoration: none; background: var(--accent-strong); }

.hidden { display: none; }

@media (min-width: 48em) {
  h1 { font-size: 2.75rem; }
  h2 { font-size: 2rem; }
  .section { padding: 4.5rem 0; }
}

/* ---------- Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.site-header .nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: 60px;
}

.brand { display: inline-flex; align-items: center; }
.brand:hover { text-decoration: none; }
.brand__logo { height: 38px; width: auto; }

.nav-burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  margin: -10px -10px -10px 0;
  cursor: pointer;
}
.nav-burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--fg);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-burger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
.nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-links {
  order: 3;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-.35rem);
  transition: max-height .3s ease, opacity .22s ease, transform .3s ease, margin .3s ease;
  margin: 0;
}
.nav-toggle:checked ~ .nav-links {
  max-height: 24rem;
  opacity: 1;
  transform: translateY(0);
  margin: .35rem 0 .85rem;
}

.nav-links a {
  display: flex;
  align-items: center;
  color: var(--fg);
  font-size: 1rem;
  font-weight: 500;
  padding: .8rem .85rem;
  border-radius: var(--radius);
  transition: background .15s ease, color .15s ease;
}
.nav-links a:hover,
.nav-links a:focus-visible {
  background: var(--bg-alt);
  color: var(--accent);
  text-decoration: none;
}

.nav-links .lang-switch {
  align-self: flex-start;
  width: auto;
  margin-top: .4rem;
  padding: .28rem .7rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.nav-links .lang-switch:hover,
.nav-links .lang-switch:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  background: none;
}

@media (prefers-reduced-motion: reduce) {
  .nav-links { transition: none; }
}

@media (min-width: 48em) {
  .site-header .nav { flex-wrap: nowrap; }
  .nav-burger { display: none; }

  .nav-links,
  .nav-toggle:checked ~ .nav-links {
    order: 0;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    max-height: none;
    opacity: 1;
    overflow: visible;
    transform: none;
    margin: 0;
  }
  .nav-links a { font-size: .95rem; padding: 0; border-radius: 0; }
  .nav-links a:hover,
  .nav-links a:focus-visible { background: none; }

  .nav-links .lang-switch {
    align-self: auto;
    margin-top: 0;
    padding: .28rem .75rem;
  }
  .nav-links .lang-switch:hover,
  .nav-links .lang-switch:focus-visible {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
  }
}

/* ---------- Sections ---------- */
.hero {
  position: relative;
  padding: 4rem 0;
  color: #fff;
  background: linear-gradient(rgba(0, 66, 57, .82), rgba(0, 48, 41, .90)),
    url("/assets/hero-96d73693.jpg") center / cover no-repeat;
}
.hero h1 { color: #fff; }
.hero__subtitle { font-size: 1.1rem; color: #e4e7eb; max-width: 45ch; }
.hero .btn { margin-top: 1.25rem; }

.about-top {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.specialties {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 1rem;
}
.specialty {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.specialty h3 { margin: 0 0 .35rem; font-size: 1.1rem; }
.specialty p { margin: 0; color: var(--muted); }

@media (min-width: 48em) {
  .hero { padding: 5rem 0; }
  .about-top { grid-template-columns: 1fr 1fr; gap: 3rem; }
  .specialties { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Brands ---------- */
.brand-group { margin-top: 2rem; }
.brand-group__title {
  font-size: 1.1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: .4rem;
  margin-bottom: 1.25rem;
}

.brand-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.brand-card {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  min-height: 96px;
}
.brand-card img {
  max-height: 56px;
  width: auto;
  filter: grayscale(1);
  opacity: .85;
  transition: filter .2s ease, opacity .2s ease;
}
.brand-card:hover img { filter: grayscale(0); opacity: 1; }

@media (min-width: 40em) {
  .brand-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 64em) {
  .brand-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Slider ---------- */
.slider {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid var(--border);
}

.slider__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  aspect-ratio: 3 / 2;
  margin: 0;
  padding: 0;
  list-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.slider__track::-webkit-scrollbar { display: none; }

.slider__slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
}
.slider__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slider__btn { display: none; }
.slider__dots { display: none; }

.slider--ready .slider__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 72, 64, .75);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.slider--ready .slider__btn:hover { background: var(--accent); }
.slider__btn--prev { left: .5rem; }
.slider__btn--next { right: .5rem; }

.slider--ready .slider__dots {
  display: flex;
  position: absolute;
  bottom: .6rem;
  left: 0;
  right: 0;
  justify-content: center;
  gap: .4rem;
}
.slider__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  cursor: pointer;
}
.slider__dot[aria-current="true"] { background: #fff; }

@media (prefers-reduced-motion: reduce) {
  .slider__track { scroll-behavior: auto; }
}

/* ---------- Form ---------- */
.contact-grid {
  display: grid;
  gap: 2rem;
  margin-top: 1.5rem;
}

.contact-details p { margin: .35rem 0; }

.contact-form p { margin: 0 0 1rem; }
.contact-form label {
  display: block;
  font-weight: 600;
  margin-bottom: .3rem;
  font-size: .9rem;
}
.contact-form input:not(.btn),
.contact-form textarea {
  width: 100%;
  padding: .65rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  background: #fff;
}
.contact-form textarea { resize: vertical; }
.contact-form-notice {
  margin: 0 0 1rem;
  padding: .75rem;
  border-left: 4px solid var(--accent);
  background: var(--bg-alt);
}
.contact-form-notice--error { border-left-color: #b42318; }
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.field-error { color: #b42318; font-size: .85rem; margin: .25rem 0 0; }
/* Visually-hidden honeypot field. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (min-width: 48em) {
  .contact-grid { grid-template-columns: 1fr 1fr; gap: 3rem; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--fg);
  color: #cbd2d9;
  padding: 1.5rem 0;
  margin-top: 2rem;
}
.site-footer p { margin: 0; font-size: .9rem; }

/* ---------- Admin ---------- */
.admin-header {
  background: var(--fg);
  color: #fff;
  border-bottom: 3px solid var(--accent);
}
.admin-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  flex-wrap: wrap;
}
.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: #fff;
  font-weight: 600;
}
.admin-brand:hover { text-decoration: none; }
.admin-brand .brand__logo { height: 32px; background: #fff; padding: 3px 6px; border-radius: 6px; }
.admin-nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.admin-nav a { color: #e4e7eb; font-size: .95rem; }
.admin-nav a:hover { color: #fff; }
.admin-signout {
  background: transparent;
  color: #e4e7eb;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: var(--radius);
  padding: .35rem .7rem;
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
}
.admin-signout:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.admin-main { padding: 2rem 1.25rem 4rem; }
.admin-main h1 { font-size: 1.8rem; }

.flash { padding: .75rem 1rem; border-radius: var(--radius); margin: 0 0 1.25rem; }
.flash--notice { background: #e6f4ea; border-left: 4px solid var(--accent); }
.flash--alert { background: #fdecea; border-left: 4px solid #b42318; color: #7a271a; }

.admin-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 1.5rem 0; }
.admin-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: #fff;
}
.admin-card .num { font-size: 2rem; font-weight: 700; color: var(--accent); }

.admin-table { width: 100%; border-collapse: collapse; margin-top: 1rem; background: #fff; }
.admin-table th, .admin-table td { text-align: left; padding: .65rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table th { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.admin-table img { max-height: 40px; width: auto; }
.admin-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

.admin-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }

.admin-form { max-width: 640px; margin-top: 1.5rem; }
.admin-form .field { margin-bottom: 1.1rem; }
.admin-form label { display: block; font-weight: 600; margin-bottom: .3rem; }
.admin-form input[type=text],
.admin-form input[type=email],
.admin-form input[type=password],
.admin-form input[type=number],
.admin-form input[type=file],
.admin-form textarea {
  width: 100%;
  padding: .6rem .7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  background: #fff;
}
.admin-form .hint { color: var(--muted); font-size: .85rem; margin-top: .25rem; }

.assignments { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .5rem; }
.assignment { display: flex; align-items: center; gap: .75rem; border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .75rem; }
.assignment .assignment__pos { width: 90px; }

.form-errors { background: #fdecea; border-left: 4px solid #b42318; padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1.25rem; }
.form-errors ul { margin: .25rem 0 0; padding-left: 1.1rem; }

.btn--secondary { background: #e4e7eb; color: var(--fg); }
.btn--secondary:hover { background: #d2d6dc; }
.btn--danger { background: #b42318; }
.btn--danger:hover { background: #912018; }
.btn--small { padding: .4rem .7rem; font-size: .85rem; }

.auth-card { max-width: 380px; margin: 3rem auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; }
.auth-card h1 { font-size: 1.4rem; margin-bottom: 1.25rem; }
.current-logo { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.current-logo img { max-height: 48px; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 4px; }
