/*
 * style.css - Shared base styles across all MK9 pages
 * Usage: <link rel="stylesheet" href="/shared/css/style.css" />
 * Load this BEFORE headerfooter.css and any page-specific CSS
 */

/* ===== BASE VARIABLES ===== */
:root {
  --primary-bg: #ffffff;
  --secondary-bg: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --accent: #2563eb;
  --accent-light: #3b82f6;
  --border: #e2e8f0;
  --gradient: linear-gradient(135deg, #2563eb, #3b82f6);
  --shadow: 0 4px 14px rgba(0,0,0,0.08);
  --transition: all .3s ease;
}

.dark-mode {
  --primary-bg: #0f172a;
  --secondary-bg: #1e293b;
  --card-bg: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --accent: #60a5fa;
  --accent-light: #93c5fd;
  --border: #334155;
  --shadow: 0 4px 14px rgba(0,0,0,0.4);
}

/* ===== BODY DEFAULTS ===== */
body {
  background: var(--primary-bg);
  color: var(--text-primary);
  font-family: 'Segoe UI', system-ui, sans-serif;
  transition: var(--transition);
}

/* ===== SECTION TITLE ===== */
.section-title {
  font-size: 1.8rem;
  text-align: center;
  font-weight: bold;
  margin: 3rem 0 1.5rem;
}
.section-title::after {
  content: "";
  display: block;
  width: 70px;
  height: 4px;
  margin: 0.5rem auto;
  background: var(--gradient);
  border-radius: 3px;
}

/* ===== FADE UP ANIMATION ===== */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.7s ease forwards;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== HOVER LIFT ===== */
.hover-lift {
  transition: transform .3s ease, box-shadow .3s ease;
}
.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

/* ===== CTA BUTTON ===== */
.cta-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  background: var(--gradient);
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-block;
  text-decoration: none;
}
.cta-btn:hover {
  transform: translateY(-3px);
  opacity: 0.9;
}

/* ===== CARD GRID ===== */
.cards-grid {
  max-width: 1200px;
  margin: auto;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px,1fr));
  gap: 1.5rem;
}

.card {
  background: var(--card-bg);
  padding: 1.8rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  display: block;
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-light);
}

.card-icon {
  font-size: 1.8rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card h3 {
  margin: 0.8rem 0;
  font-size: 1.3rem;
  color: var(--accent);
  font-weight: 600;
}

.card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ===== CONTACT INTRO SECTION ===== */
.contact-intro {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1rem 0;
}
.contact-intro h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.contact-intro h2::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--gradient);
  border-radius: 2px;
  margin: 0.6rem auto 0;
}
.contact-intro p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: 0.75rem;
  line-height: 1.5;
}

/* ===== CONTACT FORM (loaded dynamically) ===== */
.contact-form-wrapper {
  --input-bg: #f8faff;
  --radius: 12px;
  background: var(--card-bg);
  padding: 2rem 2.25rem;
  border-radius: 20px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 640px;
  margin: 2rem auto;
  border: 1px solid var(--border);
}

.contact-form-wrapper h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.contact-form-wrapper h2::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--gradient);
  border-radius: 2px;
  margin: 0.6rem auto 0;
}

.form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.1rem;
}

.contact-form-wrapper input,
.contact-form-wrapper select,
.contact-form-wrapper textarea {
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 0.925rem;
  transition: var(--transition);
  font-family: inherit;
}

.contact-form-wrapper input:hover,
.contact-form-wrapper select:hover,
.contact-form-wrapper textarea:hover {
  border-color: var(--accent-light);
}

.contact-form-wrapper input:focus,
.contact-form-wrapper select:focus,
.contact-form-wrapper textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: var(--card-bg);
  outline: none;
}

.contact-form-wrapper input::placeholder,
.contact-form-wrapper textarea::placeholder {
  color: var(--text-secondary);
}

.contact-form-wrapper textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

.contact-form-wrapper select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-submit-btn {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 0.25rem;
}

.form-submit-btn:hover {
  background: var(--accent-light);
}

.form-submit-btn:active {
  transform: scale(0.98);
}

.form-submit-btn i {
  font-size: 0.9rem;
  transition: var(--transition);
}

.form-submit-btn:hover i {
  transform: translateX(3px);
}

.error-msg {
  color: #dc2626;
  font-size: 0.78rem;
  margin-top: 4px;
  display: none;
}

.contact-form-wrapper .alert {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  text-align: center;
  font-weight: 500;
  font-size: 0.9rem;
  animation: alertSlide 0.3s ease;
}

@keyframes alertSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.contact-form-wrapper .success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.contact-form-wrapper .error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.dark-mode .contact-form-wrapper {
  --input-bg: #1e293b;
}
.dark-mode .contact-form-wrapper select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.dark-mode .contact-form-wrapper .success {
  background: #052e16;
  color: #4ade80;
  border: 1px solid #166534;
}

.dark-mode .contact-form-wrapper .error {
  background: #450a0a;
  color: #fca5a5;
  border: 1px solid #991b1b;
}

@media (max-width: 640px) {
  .contact-form-wrapper {
    padding: 1.25rem 1rem;
    margin: 1rem 0.5rem;
    border-radius: 16px;
  }
  .contact-form-wrapper h2 {
    font-size: 1.3rem;
  }
  .contact-form-wrapper input,
  .contact-form-wrapper select,
  .contact-form-wrapper textarea {
    font-size: 16px;
  }
}

/* ===== PAGE COMPONENTS (p-*) ===== */

.p-hero {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  padding: 5rem 1rem;
  text-align: center;
}
.p-hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 1rem;
}
.p-hero p {
  font-size: 1.1rem;
  color: #cbd5e1;
  max-width: 750px;
  margin: 0 auto;
  line-height: 1.7;
}

.p-section {
  padding: 4rem 1rem;
}
.p-alt {
  background: var(--secondary-bg);
}

.p-container {
  max-width: 1200px;
  margin: 0 auto;
}

.p-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}
.p-subtitle {
  text-align: center;
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 3rem;
  line-height: 1.6;
}

.p-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.p-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.p-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
  text-align: center;
}
.p-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-light);
}
.p-card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
}
.p-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text-primary);
}
.p-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}
.p-card ul {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}
.p-card ul li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  padding: 0.35rem 0 0.35rem 1.4rem;
  position: relative;
  line-height: 1.4;
}
.p-card ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.p-badge {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.25rem 0.85rem;
  background: var(--gradient);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
}

.p-cta {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--gradient);
  border-radius: 24px;
}
.p-cta h2 {
  font-size: 1.6rem;
  color: #fff;
  margin: 0 0 0.75rem;
}
.p-cta p {
  color: rgba(255,255,255,0.85);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.p-stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
}

@media (max-width: 900px) {
  .p-grid-3, .p-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .p-hero h1 { font-size: 1.8rem; }
}
@media (max-width: 600px) {
  .p-grid-3, .p-grid-4 { grid-template-columns: 1fr; }
  .p-hero { padding: 3rem 1rem; }
  .p-hero h1 { font-size: 1.5rem; }
  .p-title { font-size: 1.5rem; }
  .p-cta { padding: 2rem 1rem; }
}
