/* Mattech — Dark theme */
:root {
  --bg: #0a0a0f;
  --bg-alt: #12121a;
  --bg-card: #16161f;
  --border: #1e1e2e;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #00d4ff;
  --accent-dim: rgba(0, 212, 255, 0.15);
  --violet: #7c3aed;
  --violet-dim: rgba(124, 58, 237, 0.15);
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --nav-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.mono { font-family: var(--mono); color: var(--accent); font-size: 0.85em; }

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

a { color: var(--accent); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.85; }

/* Logo */
.logo {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo span { color: var(--accent); }
.logo--hero { font-size: clamp(2.5rem, 8vw, 4.5rem); }

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}
.nav__links a { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.nav__links a:hover { color: var(--text); }
.nav__cta {
  padding: 0.5rem 1rem !important;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent) !important;
}
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  overflow: hidden;
}
.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black, transparent);
}
.hero__content {
  position: relative;
  z-index: 1;
  padding: 4rem 1.25rem;
}
.hero__badge {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.hero__tagline {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
  margin: 1rem 0;
  color: var(--text);
}
.hero__subtitle {
  max-width: 560px;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
}
.hero__scroll a {
  color: var(--text-muted);
  font-size: 1.5rem;
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background: linear-gradient(135deg, var(--accent), #0099cc);
  color: var(--bg);
  box-shadow: 0 4px 24px rgba(0, 212, 255, 0.25);
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn--full { width: 100%; }
.btn--danger { background: var(--error); color: #fff; }
.btn--sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Sections */
.section {
  padding: 6rem 0;
}
.section--alt { background: var(--bg-alt); }
.section__header { margin-bottom: 3rem; }
.section__label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.section__header h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section__desc { color: var(--text-muted); margin-top: 0.5rem; }

/* About */
.about__grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .about__grid { grid-template-columns: 1.2fr 0.8fr; }
}
.about__text p { color: var(--text-muted); margin-bottom: 1rem; }
.about__text strong { color: var(--text); }
.about__skills {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.about__skills li {
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 500;
}

/* Cards */
.cards {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .cards { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover {
  border-color: rgba(0, 212, 255, 0.3);
  transform: translateY(-2px);
}
.card__icon { font-size: 2rem; margin-bottom: 1rem; }
.card h3 { font-size: 1.15rem; margin-bottom: 0.75rem; }
.card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }
.card__price {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
}

/* Pricing table */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.pricing-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
}
.pricing-table th,
.pricing-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.pricing-table th {
  background: var(--bg-alt);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.pricing-table tr:last-child td { border-bottom: none; }
.pricing-table td strong { color: var(--accent); font-family: var(--mono); font-size: 0.9rem; }

/* Contact */
.contact__grid {
  display: grid;
  gap: 2.5rem;
}
@media (min-width: 768px) {
  .contact__grid { grid-template-columns: 1fr 1.5fr; }
}
.contact__info p { color: var(--text-muted); margin-bottom: 1rem; }
.contact__email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.contact__note { font-size: 0.9rem; }

/* Form */
.form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.form__row { margin-bottom: 1.25rem; }
.form__row--2 {
  display: grid;
  gap: 1rem;
}
@media (min-width: 500px) {
  .form__row--2 { grid-template-columns: 1fr 1fr; }
}
.form label, .form .label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}
.form input,
.form select,
.form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.radio-group { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--text);
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert--success { background: rgba(34, 197, 94, 0.15); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.3); }
.alert--error { background: rgba(239, 68, 68, 0.15); color: var(--error); border: 1px solid rgba(239, 68, 68, 0.3); }

/* Footer */
.footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}
.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: center;
}
@media (min-width: 768px) {
  .footer__inner {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }
}
.footer__brand { display: flex; flex-direction: column; gap: 0.5rem; }
.footer__links { display: flex; gap: 1.5rem; }
.footer__links a { color: var(--text-muted); }
.footer__copy { width: 100%; color: var(--text-muted); font-size: 0.85rem; text-align: center; }

/* Auth pages */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  background: var(--bg);
}
.auth-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(124, 58, 237, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 58, 237, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
}
.auth-card h1 { font-size: 1.5rem; margin: 1rem 0 0.5rem; }
.auth-card > p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.auth-card .form { background: none; border: none; padding: 0; }
.auth-footer { margin-top: 1.5rem; text-align: center; font-size: 0.9rem; color: var(--text-muted); }
.password-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
.password-strength { height: 4px; background: var(--border); border-radius: 2px; margin-top: 0.5rem; overflow: hidden; }
.password-strength__bar { height: 100%; width: 0; transition: width 0.3s, background 0.3s; }

/* Dashboard */
.dashboard {
  min-height: 100vh;
  padding-top: var(--nav-h);
}
.dashboard__header {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.dashboard__header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.dashboard__main { padding: 2rem 0 4rem; }

.ticket-list { display: flex; flex-direction: column; gap: 0.75rem; }
.ticket-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s;
}
.ticket-item:hover { border-color: rgba(0, 212, 255, 0.3); }
.ticket-item__meta { font-size: 0.85rem; color: var(--text-muted); }
.ticket-item__title { font-weight: 600; }

.badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--mono);
}
.badge--en_attente { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge--en_cours { background: var(--accent-dim); color: var(--accent); }
.badge--resolu { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge--ferme { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }

.ticket-detail {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
}
.ticket-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
}
.ticket-detail__back:hover { color: var(--accent); }

.comments { margin-top: 2rem; }
.comment {
  padding: 1rem;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  border-left: 3px solid var(--violet);
}
.comment__meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

/* Admin */
.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.admin-filters input,
.admin-filters select {
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.7);
}
.modal[hidden] { display: none; }
.modal__content {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.modal__close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.admin-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Mobile nav */
@media (max-width: 768px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
    gap: 1rem;
    transform: translateY(-120%);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    pointer-events: none;
  }
  .nav__links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
}
