/* =====================================================
   RLB Consulting — style.css
   Full brand-compliant CSS: tokens, layout, responsive,
   all components.
   ===================================================== */

/* === BRAND TOKENS === */
:root {
  --color-primary:    #0F4C81;
  --color-secondary:  #4A4A4A;
  --color-bg-alt:     #F5F7FA;
  --color-bg-base:    #FFFFFF;
  --color-text:       #1F2937;
  --color-border:     #dbe3ec;

  --font-heading: 'Montserrat', Arial, sans-serif;
  --font-body:    'Inter', Arial, sans-serif;

  --nav-height: 72px;
  --section-padding: 5rem 1.5rem;
  --container-max: 1200px;
  --radius-card: 12px;
}

/* === MOBILE SAFETY NET === */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

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

input, textarea, select {
  font-size: 16px; /* TECH-04: prevents iOS auto-zoom */
}

/* === BASE === */
html {
  scroll-behavior: smooth; /* NAV-03 */
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.65;
  background: var(--color-bg-base);
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

p {
  margin-top: 0;
}

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

section {
  scroll-margin-top: var(--nav-height); /* prevents content hiding behind sticky nav */
  padding: var(--section-padding);
}

footer {
  scroll-margin-top: var(--nav-height);
}

.section-title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  margin-bottom: 2.5rem;
  text-align: center;
}

/* Alternating section backgrounds */
.section-hero    { background: var(--color-bg-base); }
.section-services { background: var(--color-bg-alt); }
.section-about   { background: var(--color-bg-base); }
.section-contact  { background: var(--color-bg-alt); }

/* === HEADER / NAV === */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-height);
  background: var(--color-bg-base);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav-logo img {
  height: 56px;
  width: auto;
  max-width: 200px;
  display: block;
}

.nav-links {
  display: none; /* hidden on mobile — Phase 2 JS toggles; shown at 768px+ */
  gap: 2rem;
}

.nav-link {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--color-secondary);
  transition: color 200ms ease;
}

.nav-link:hover {
  color: var(--color-primary);
}

.nav-hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-secondary);
  border-radius: 2px;
  transition: transform 200ms ease, opacity 200ms ease;
}

/* Show full nav on tablet+ */
@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
  .nav-hamburger {
    display: none;
  }
}

/* === BUTTONS === */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  padding: 0.875rem 2rem;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  text-align: center;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: #0d4273; /* slightly darker #0F4C81 */
  box-shadow: 0 4px 16px rgba(15, 76, 129, 0.3);
  transform: translateY(-1px);
}

/* === HERO === */
.section-hero {
  min-height: 60dvh; /* dvh avoids mobile browser chrome overlap */
  display: flex;
  align-items: center;
  text-align: center;
}

.hero-content {
  max-width: 720px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(1.75rem, 5vw, 3rem);
  line-height: 1.25;
  margin-bottom: 1.25rem;
  color: var(--color-primary);
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--color-secondary);
  margin-bottom: 2rem;
  line-height: 1.7;
}

/* === SERVICES === */
.services-grid {
  display: grid;
  grid-template-columns: 1fr; /* mobile: single column (SERV-04) */
  gap: 1.5rem;
  max-width: var(--container-max);
  margin: 0 auto;
}

@media (min-width: 768px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr); /* tablet+: three columns (SERV-01) */
  }
}

.service-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 2rem 1.5rem;
  background: var(--color-bg-base);
  transition: box-shadow 200ms ease, transform 200ms ease;
}

.service-card:hover {
  box-shadow: 0 8px 32px rgba(15, 76, 129, 0.15);
  transform: translateY(-2px); /* VIS-05 */
}

.service-card__icon {
  font-size: 2.5rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.service-card__title {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.service-card__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.service-card__list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--color-secondary);
}

.service-card__list li i {
  color: var(--color-primary);
  margin-top: 0.2rem;
  flex-shrink: 0;
}

/* === ABOUT === */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: var(--container-max);
  margin: 0 auto;
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.about-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.about-item__icon {
  font-size: 1.75rem;
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.about-item h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: var(--color-primary);
}

.about-item p {
  font-size: 0.95rem;
  color: var(--color-secondary);
  margin-bottom: 0;
}

/* === CONTACT === */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--color-secondary);
}

.form-group input {
  /* font-size: 16px already set in Mobile Safety Net (TECH-04) */
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  width: 100%;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg-base);
  transition: border-color 200ms ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.12);
}

.contact-form .btn {
  align-self: flex-start;
}

/* === FOOTER === */
.site-footer {
  background: var(--color-primary);
  color: rgba(255, 255, 255, 0.9);
  padding: 3rem 1.5rem;
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.site-footer p {
  margin: 0;
  font-size: 0.9rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
}

.site-footer a:hover {
  color: #ffffff;
}

.footer-copy {
  margin-top: 1.5rem !important;
  font-size: 0.8rem !important;
  opacity: 0.7;
}

/* === WHATSAPP FAB === */
.whatsapp-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 40;
  background: #25D366;
  color: #ffffff;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.whatsapp-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   PHASE 2 ADDITIONS
   ============================================================ */

/* --- NAV: Mobile open state (toggled by JS adding .nav-open) --- */
.nav-open .nav-links {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--color-bg-base);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 1rem 1.5rem;
  gap: 1rem;
  z-index: 40;
}

/* Hamburger bars → X when menu is open */
.nav-open .nav-hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-open .nav-hamburger span:nth-child(2) {
  opacity: 0;
}
.nav-open .nav-hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- SCROLL FADE-IN: IntersectionObserver animation states --- */
[data-animate] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 400ms ease, transform 400ms ease;
}

[data-animate].is-visible {
  opacity: 1;
  transform: none;
}

/* Accessibility: skip hidden state and transition for reduced-motion users */
@media (prefers-reduced-motion: reduce) {
  [data-animate] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --- FORM: Inline validation error states --- */
.form-group__error {
  display: block;
  font-size: 0.875rem;
  color: #d32f2f;
  margin-top: 0.25rem;
  min-height: 1.25rem; /* reserve space to prevent layout shift */
}

.form-group input.is-invalid {
  border-color: #d32f2f;
  outline-color: #d32f2f;
}

/* --- FORM: Submission feedback messages --- */
#form-feedback {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.9375rem;
  display: none; /* hidden until JS adds a feedback class */
}

#form-feedback.feedback--success {
  display: block;
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #a5d6a7;
}

#form-feedback.feedback--error {
  display: block;
  background: #ffebee;
  color: #b71c1c;
  border: 1px solid #ef9a9a;
}
