/*
 * 3S Decision Layer — access portal
 * Copyright (c) 2026 3S Holding OÜ, Tartu, Estonia. All rights reserved.
 * Author: Prof. Shahab Anbarjafari
 *
 * Mirrors the 3sholding.com design system: neutral light surfaces, a red primary
 * gradient, rounded cards with soft shadows and the system UI typeface.
 */

:root {
  --background: hsl(0 0% 98%);
  --foreground: hsl(0 0% 9%);
  --card: hsl(0 0% 100%);
  --muted: hsl(0 0% 96%);
  --muted-foreground: hsl(0 0% 45%);
  --border: hsl(0 0% 89%);
  --input: hsl(0 0% 96%);
  --primary: hsl(0 84% 60%);
  --primary-glow: hsl(0 84% 70%);
  --primary-soft: hsl(0 84% 60% / 0.1);
  --gradient-primary: linear-gradient(135deg, hsl(0 84% 60%), hsl(0 84% 70%));
  --gradient-hero: linear-gradient(135deg, hsl(0 0% 98%) 0%, hsl(0 0% 96%) 50%, hsl(0 0% 94%) 100%);
  --shadow-elegant: 0 10px 30px -10px hsl(0 0% 0% / 0.1);
  --shadow-glow: 0 0 40px hsl(0 84% 60% / 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 0.5rem;
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--foreground);
  background: var(--background);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--muted);
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
}

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

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: hsl(0 0% 98% / 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav__links a:not(.btn) {
  color: var(--muted-foreground);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.nav__links a:not(.btn):hover {
  color: var(--primary);
}

/* Buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  border-radius: var(--radius);
  padding: 0.65rem 1.25rem;
  font: 600 0.95rem var(--font);
  color: #fff;
  background: var(--gradient-primary);
  box-shadow: var(--shadow-elegant);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn:hover {
  box-shadow: var(--shadow-glow), var(--shadow-elegant);
  transform: translateY(-1px);
}

.btn:focus-visible,
input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn--sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.875rem;
}

.btn--lg {
  padding: 0.9rem 2rem;
  font-size: 1.05rem;
}

.btn--block {
  width: 100%;
}

.btn[disabled] {
  cursor: progress;
  opacity: 0.8;
  transform: none;
}

.spinner {
  display: none;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid hsl(0 0% 100% / 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn.is-loading .spinner {
  display: inline-block;
}

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

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 4rem);
  padding: 5rem 0;
  background: var(--gradient-hero);
}

.hero--compact {
  min-height: 60vh;
  display: flex;
  align-items: center;
}

.hero__line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
}

.hero__line--top {
  top: 25%;
  background: hsl(0 84% 60% / 0.3);
}

.hero__line--bottom {
  bottom: 33%;
  background: hsl(0 84% 60% / 0.2);
}

.hero__bg {
  position: absolute;
  inset: 0;
  opacity: 0.1;
  background: url('../img/hero-bg.jpg') center / cover no-repeat;
}

.hero__inner {
  position: relative;
  z-index: 1;
}

.hero__copy {
  max-width: 56rem;
  margin: 0 auto 3.5rem;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
}

h2,
.h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  margin: 0 auto;
  max-width: 48rem;
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  color: var(--muted-foreground);
}

.muted {
  color: var(--muted-foreground);
  margin-top: 0;
}

/* Cards */
.grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 2rem;
  max-width: 64rem;
  margin: 0 auto;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 2);
  padding: 2rem;
  box-shadow: var(--shadow-elegant);
}

.card--form {
  transition: var(--transition);
}

.card--form:hover {
  box-shadow: var(--shadow-glow), var(--shadow-elegant);
}

.card--narrow {
  max-width: 36rem;
  margin: 0 auto;
  text-align: center;
}

.features {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}

.features li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.features p {
  margin: 0.15rem 0 0;
  color: var(--muted-foreground);
  font-size: 0.95rem;
}

.features__icon,
.result__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius);
  background: var(--primary-soft);
}

.features__icon svg,
.result__icon svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.note {
  margin: 0;
  padding: 1rem;
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

/* Form */
.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.field input[type='text'],
.field input[type='email'] {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input);
  font: 1rem var(--font);
  color: var(--foreground);
  transition: var(--transition);
}

.field input:focus {
  background: var(--card);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  outline: none;
}

.field input[aria-invalid='true'] {
  border-color: var(--primary);
}

.field--check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
}

.field--check input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.2rem;
  accent-color: var(--primary);
}

.field--check label {
  margin: 0;
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.field--check .field__error {
  grid-column: 1 / -1;
}

.field__error {
  min-height: 0;
  margin: 0.35rem 0 0;
  color: var(--primary);
  font-size: 0.85rem;
}

.field__error:empty {
  display: none;
}

.alert {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid hsl(0 84% 60% / 0.35);
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: hsl(0 70% 40%);
  font-size: 0.95rem;
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.result {
  text-align: center;
  padding: 1.5rem 0;
}

.result__icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
}

.result__icon svg {
  width: 2rem;
  height: 2rem;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 2rem 0;
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer p {
  margin: 0;
}

.footer a {
  text-decoration: none;
}

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

.brand--footer {
  color: var(--foreground);
  font-size: 1rem;
}

@media (max-width: 860px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .card--form {
    order: -1;
  }

  .nav__links a:not(.btn) {
    display: none;
  }

  .hero {
    padding: 3rem 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
