/* Dynamic Design System with CSS Variables */
:root {
  --primary-color: #0d9488;
  --secondary-color: #0f766e;
  --button-color: #0d9488;
  --text-color: #1e293b;
  --bg-color: #f8fafc;
  --header-color: #ffffff;
  --footer-color: #0f172a;
  --font-family: 'Cairo', sans-serif;
  --font-size-base: 16px;
  --border-radius: 12px;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] {
  --text-color: #f1f5f9;
  --bg-color: #0f172a;
  --header-color: #1e293b;
  --card-bg: #1e293b;
  --border-color: #334155;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-size: var(--font-size-base);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  text-rendering: optimizeLegibility;
  transform: translateZ(0); /* Hardware Acceleration */
  will-change: transform;
}

button, input, select, textarea, .btn, .card, .menu-item {
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Header & Navbar */
.site-header {
  background-color: var(--header-color);
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 700;
  font-size: 1.35rem;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--border-radius);
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background-color: rgba(0,0,0,0.05);
}

.contact-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(13, 148, 136, 0.1);
  color: var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.contact-pill:hover {
  background-color: var(--primary-color);
  color: #ffffff;
}

/* Main Container */
.main-content {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.hero-banner {
  text-align: center;
  margin-bottom: 2rem;
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  opacity: 0.85;
  max-width: 650px;
  margin: 0 auto;
}

/* Stepper Progress Bar */
.stepper-container {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  position: relative;
}

.stepper-line {
  position: absolute;
  top: 20px;
  right: 10%;
  left: 10%;
  height: 3px;
  background-color: var(--border-color);
  z-index: 1;
}

.stepper-progress {
  position: absolute;
  top: 20px;
  right: 10%;
  height: 3px;
  background-color: var(--primary-color);
  z-index: 2;
  transition: width 0.4s ease;
  width: 0%;
}

.step-item {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
}

.step-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: var(--card-bg);
  border: 2px solid var(--border-color);
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: all 0.3s ease;
}

.step-item.active .step-circle {
  border-color: var(--primary-color);
  background-color: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.2);
}

.step-item.completed .step-circle {
  border-color: var(--primary-color);
  background-color: var(--primary-color);
  color: #ffffff;
}

.step-label {
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.7;
  text-align: center;
}

.step-item.active .step-label {
  opacity: 1;
  color: var(--primary-color);
  font-weight: 700;
}

/* Form Card */
.form-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  padding: 2.5rem;
  margin-bottom: 2rem;
}

.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

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

.step-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.step-header h3 {
  font-size: 1.3rem;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

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

.form-label .required {
  color: #ef4444;
  margin-right: 0.2rem;
}

.form-control, .form-select {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: calc(var(--border-radius) - 2px);
  border: 1.5px solid var(--border-color);
  background-color: var(--bg-color);
  color: var(--text-color);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-top: 0.35rem;
}

.error-text {
  color: #ef4444;
  font-size: 0.82rem;
  margin-top: 0.35rem;
  display: none;
}

.has-error .form-control, .has-error .form-select {
  border-color: #ef4444;
}

.has-error .error-text {
  display: block;
}

/* Form Action Buttons */
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.btn {
  padding: 0.85rem 1.75rem;
  border-radius: var(--border-radius);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--button-color);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

/* Review Summary List */
.review-card {
  background-color: var(--bg-color);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.review-item {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--border-color);
}

.review-item:last-child {
  border-bottom: none;
}

.review-item .label {
  font-weight: 600;
  opacity: 0.8;
}

.review-item .val {
  font-weight: 700;
  color: var(--primary-color);
}

/* Success Card View */
.success-card {
  text-align: center;
  padding: 3rem 2rem;
  display: none;
}

.success-card.active {
  display: block;
}

.success-icon {
  width: 80px;
  height: 80px;
  background-color: #d1fae5;
  color: #059669;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 1.5rem;
}

.request-id-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background-color: rgba(13, 148, 136, 0.1);
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 800;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  border: 1px dashed var(--primary-color);
  margin: 1.5rem 0;
  letter-spacing: 1px;
}

.btn-copy {
  background: var(--card-bg);
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 8px;
  cursor: pointer;
}

/* Footer */
.site-footer {
  background-color: var(--footer-color);
  color: #f8fafc;
  padding: 2.5rem 1.5rem 1.5rem;
  margin-top: auto;
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.footer-col p {
  opacity: 0.8;
  font-size: 0.9rem;
}

.social-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.social-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.social-icon:hover {
  background-color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  opacity: 0.7;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background-color: var(--card-bg);
  color: var(--text-color);
  border-right: 4px solid var(--primary-color);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  min-width: 280px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-title { font-size: 1.6rem; }
  .form-card { padding: 1.5rem; }
  .stepper-container { margin-bottom: 1.5rem; }
  .step-label { font-size: 0.7rem; }
  .step-circle { width: 34px; height: 34px; font-size: 0.85rem; }
  .stepper-line, .stepper-progress { top: 16px; }
  .contact-pill span { display: none; }
}
