/* ============================================
   SMARTSERVICES Schools - Main Stylesheet
   ============================================ */
.logo-image{
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.logo2-image {
  display: block;
  width: 300px;
  height: auto;
  object-fit: cover;
  margin: 0 auto 24px;
}
/* ===== FILE UPLOAD ===== */
.upload-area input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  z-index: -1;
}

.upload-area {
  position: relative;
  border: 2px dashed #ddd;
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: #fafafa;
}

.upload-area:hover {
  border-color: var(--primary);
  background: #fff8f0;
}

.upload-area.dragover {
  border-color: var(--primary);
  background: #fff8f0;
}

.upload-icon {
  font-size: 2.5rem;
  color: var(--primary-light);
  margin-bottom: 12px;
  display: block;
}

.upload-text {
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.upload-hint {
  font-size: 0.8rem;
  color: var(--text-light);
}

.upload-message {
  margin-top: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  display: none;
}

.upload-message.success {
  display: block;
  color: #10b981;
}

.upload-message.error {
  display: block;
  color: #ef4444;
}

.file-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.file-preview-item {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--white);
}

.file-preview-image {
  width: 100%;
  height: 100px;
  object-fit: cover;
}

.file-preview-pdf {
  height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  color: var(--text-light);
  font-size: 0.75rem;
  font-weight: 700;
}

.file-preview-pdf i {
  font-size: 2rem;
  color: #ef4444;
  margin-bottom: 4px;
}

.file-preview-info {
  padding: 8px;
}

.file-preview-name {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-dark);
}

.file-preview-size {
  font-size: 0.7rem;
  color: var(--text-light);
}

.file-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.file-remove-btn:hover {
  background: #ef4444;
}

/* ===== CSS VARIABLES ===== */
:root {
  --primary: #ff6b00;
  --primary-light: #ff8c00;
  --secondary: #1e293b;
  --text-dark: #1e293b;
  --text-light: #64748b;
  --bg-light: #f5f6fa;
  --white: #ffffff;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: all 0.3s ease;
  --font-family: 'Nunito', 'Noto Sans Arabic', sans-serif;
}

/* ===== GLOBAL STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  color: var(--text-dark);
  line-height: 1.6;
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

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

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

/* ===== TOP BAR ===== */
.top-bar {
  background: var(--secondary);
  color: var(--white);
  padding: 8px 0;
  font-size: 0.85rem;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar a {
  color: var(--white);
  opacity: 0.9;
}

.top-bar a:hover {
  opacity: 1;
}

.top-bar-left,
.top-bar-right {
  display: flex;
  gap: 20px;
  align-items: center;
}

.top-bar i {
  margin-inline-end: 6px;
}

/* ===== MAIN HEADER ===== */
.main-header {
  background: var(--white);
  padding: 20px 0;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--white);
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1.2;
  color: var(--secondary);
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-dark);
  padding: 8px 0;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.lang-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-bar .lang-selector i {
  margin-inline-end: 0;
  opacity: 0.9;
}

.lang-selector select {
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.85rem;
  cursor: pointer;
  background: var(--white);
  color: var(--text-dark);
  min-width: 120px;
}

.top-bar .lang-selector select {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--white);
}

.top-bar .lang-selector select option {
  background: var(--secondary);
  color: var(--white);
}

/* ===== LANGUAGE DIRECTION SUPPORT ===== */
/* LTR (French / English) — explicit left alignment */
html[lang="fr"] body,
html[lang="en"] body {
  direction: ltr;
  text-align: left;
}

/* RTL (Arabic) */
[dir="rtl"] .top-bar i,
body.rtl .top-bar i {
  margin-inline-end: 0;
  margin-inline-start: 6px;
}

[dir="rtl"] .nav-links a.active::after,
body.rtl .nav-links a.active::after {
  left: 0;
  right: 0;
}

[dir="rtl"] .hero .container,
body.rtl .hero .container {
  direction: rtl;
}

[dir="rtl"] .footer-grid,
[dir="rtl"] .services-grid,
[dir="rtl"] .steps-grid,
[dir="rtl"] .benefits-grid,
body.rtl .footer-grid,
body.rtl .services-grid,
body.rtl .steps-grid,
body.rtl .benefits-grid {
  direction: rtl;
}

[dir="rtl"] .btn i,
body.rtl .btn i {
  transform: scaleX(-1);
}

[dir="rtl"] .form-row,
body.rtl .form-row {
  direction: rtl;
}

[dir="rtl"] .main-header .container,
body.rtl .main-header .container {
  direction: rtl;
}

[dir="rtl"] .modal-header,
body.rtl .modal-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .dropdown-arrow,
body.rtl .dropdown-arrow {
  margin-inline-start: 0;
  margin-inline-end: 4px;
}

.dropdown-arrow {
  font-size: 0.7rem;
  margin-inline-start: 4px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
  font-family: var(--font-family);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 0, 0.4);
}

.btn-outline {
  background: var(--white);
  color: var(--primary);
  border: 2px solid var(--primary);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* ===== HERO SECTION ===== */
.hero {
  padding: 80px 0 60px;
  background: linear-gradient(135deg, #f5f6fa 0%, #e5e7eb 100%);
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-content {
  max-width: 600px;
}

.hero-subtitle {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--secondary);
}

.hero h1 .orange {
  color: var(--primary);
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-image-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image-wrapper img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-width: 100%;
  height: auto;
}

/* ===== SECTION STYLES ===== */
.section {
  padding: 80px 0;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 16px;
  color: var(--secondary);
}

.section-title .orange {
  color: var(--primary);
}

.section-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto 48px;
}

/* ===== SERVICES GRID ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
  justify-items: stretch;
}

.service-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
}

.service-image {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: var(--bg-light);
}

.service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.service-card:hover .service-image img {
  transform: scale(1.05);
}

.service-icon-overlay {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.2rem;
  box-shadow: 0 4px 8px rgba(255, 107, 0, 0.4);
}

/* Hide baked-in Arabic badge on images when in French or English */
html[lang="fr"] .service-image::after,
html[lang="en"] .service-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 60px; /* leave room for icon overlay on right */
  height: 40px;
  background: linear-gradient(to right, var(--white), var(--white) 70%, transparent);
  pointer-events: none;
}

.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-body h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--secondary);
}

.card-body p {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}

/* Button consistent bottom alignment */
.card-body .btn {
  margin-top: auto;
  align-self: flex-start;
}

.service-card-highlight {
  border: 2px dashed var(--primary);
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.03) 0%, rgba(255, 140, 0, 0.03) 100%);
}

.service-card-highlight:hover {
  border-style: solid;
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.06) 0%, rgba(255, 140, 0, 0.06) 100%);
}

/* ===== HOW IT WORKS ===== */
.about {
  background: var(--bg-light);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}

.step-card {
  background: var(--white);
  padding: 40px 32px;
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: var(--transition);
}

.step-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.step-number {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.2rem;
  box-shadow: 0 4px 8px rgba(255, 107, 0, 0.3);
}

.step-icon {
  width: 80px;
  height: 80px;
  background: var(--bg-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--primary);
  margin: 20px auto 16px;
}

.step-card h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--secondary);
}

.step-card p {
  color: var(--text-light);
  line-height: 1.7;
}

/* ===== BENEFITS GRID ===== */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}

.benefit-card {
  background: var(--white);
  padding: 40px 32px;
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.benefit-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.benefit-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.1) 0%, rgba(255, 140, 0, 0.1) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--primary);
  margin: 0 auto 20px;
}

.benefit-card h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--secondary);
}

.benefit-card p {
  color: var(--text-light);
  line-height: 1.7;
}

/* ===== CTA BANNER ===== */
.instagram-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: 80px 0;
  text-align: center;
}

.instagram-banner h2 {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 16px;
}

.instagram-banner p {
  font-size: 1.2rem;
  margin-bottom: 32px;
  opacity: 0.95;
}

.instagram-banner .btn {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.instagram-banner .btn:hover {
  background: var(--secondary);
  color: var(--white);
}

/* ===== USER DEVIS CARD ===== */
.devis-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.devis-card:hover {
  border-color: #8b5cf6;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.1);
  transform: translateY(-2px);
}

.devis-card .devis-icon {
  width: 56px;
  height: 56px;
  background: #fef2f2;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #dc2626;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.devis-card .devis-info {
  flex: 1;
  min-width: 0;
}

.devis-card .devis-info h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.25rem;
}

.devis-card .devis-info p {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0;
}

.devis-card .devis-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.devis-card .devis-actions .btn {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.devis-card .devis-readonly {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  margin-top: 0.25rem;
}

/* Empty devis state */
.empty-devis-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: #fafafa;
  border: 2px dashed #e5e7eb;
  border-radius: 16px;
}

.empty-devis-state i {
  font-size: 3rem;
  color: #cbd5e1;
  margin-bottom: 0.75rem;
}

.empty-devis-state h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #64748b;
  margin: 0 0 0.35rem;
}

.empty-devis-state p {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0;
}

@media (max-width: 600px) {
  .devis-card {
    flex-direction: column;
    text-align: center;
  }
  .devis-card .devis-actions {
    width: 100%;
    justify-content: center;
  }
}

/* ===== FOOTER ===== */
.footer {
  background: var(--secondary);
  color: var(--white);
  padding: 64px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-col h4 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.footer-col a {
  display: block;
  color: rgba(255,255,255,0.7);
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.footer-col a:hover {
  color: var(--primary);
  padding-inline-start: 4px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 24px 0;
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 20px;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.open .modal-content {
  transform: scale(1);
}

.modal-content-sm {
  max-width: 450px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 2px solid #e5e7eb;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--secondary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-light);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--bg-light);
  color: var(--secondary);
}

.modal-body {
  padding: 24px;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--secondary);
  font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: var(--transition);
  font-family: var(--font-family);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

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

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  color: var(--text-light);
  font-size: 0.95rem;
}

.auth-switch a,
.auth-switch .link-btn {
  color: var(--primary);
  font-weight: 700;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 0.95rem;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: inline-block;
}

.auth-switch a:hover,
.auth-switch .link-btn:hover {
  background: #fafafa;
  text-decoration: none;
}

.auth-message-content {
  background: transparent;
  box-shadow: none;
  max-width: 400px;
}

.auth-message-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 30px;
  text-align: center;
  color: var(--white);
}

.auth-message-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.auth-message-body p {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 1024px) {
  .hero .container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-content {
    max-width: 100%;
    text-align: center;
  }

  .hero h1 {
    font-size: 2.4rem;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-image-wrapper {
    order: -1;
  }

  .hero-image-wrapper img {
    max-width: 80%;
  }

  .services-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  /* Header */
  .main-header {
    padding: 12px 0;
  }

  .logo-text {
    font-size: 1rem;
  }

  .logo-image {
    width: 48px;
    height: 48px;
  }

  .header-actions {
    gap: 8px;
  }

  /* Hero */
  .hero {
    padding: 50px 0 40px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
    gap: 12px;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-image-wrapper img {
    max-width: 60%;
  }

  /* Sections */
  .section {
    padding: 60px 0;
  }

  .section-title {
    font-size: 2rem;
  }

  .section-subtitle {
    font-size: 1rem;
  }

  /* Services */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .service-image {
    height: 180px;
  }

  /* Steps */
  .steps-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .step-card {
    padding: 32px 24px;
  }

  /* Benefits */
  .benefits-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .benefit-card {
    padding: 32px 24px;
  }

  /* CTA Banner */
  .instagram-banner {
    padding: 60px 0;
  }

  .instagram-banner h2 {
    font-size: 2rem;
  }

  .instagram-banner p {
    font-size: 1rem;
  }

  /* Footer */
  .footer {
    padding: 48px 0 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-col a:hover {
    padding-inline-start: 0;
  }

  /* Modals */
  .modal-content {
    margin: 0 16px;
  }

  .modal-header {
    padding: 16px;
  }

  .modal-header h2 {
    font-size: 1.25rem;
  }

  .modal-body {
    padding: 16px;
  }

  /* Buttons */
  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  /* Top Bar - hide on very small screens to save space */
  .top-bar {
    display: none;
  }

  /* Header */
  .main-header .container {
    flex-wrap: wrap;
    gap: 12px;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
  }

  /* Hero */
  .hero {
    padding: 40px 0 30px;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero-subtitle {
    font-size: 0.75rem;
  }

  .hero-description {
    font-size: 0.95rem;
  }

  .hero-image-wrapper img {
    max-width: 50%;
  }

  /* Sections */
  .section {
    padding: 50px 0;
  }

  .section-title {
    font-size: 1.75rem;
  }

  /* Service Cards */
  .service-image {
    height: 160px;
  }

  .card-body {
    padding: 20px;
  }

  .card-body h3 {
    font-size: 1.1rem;
  }

  .card-body p {
    font-size: 0.9rem;
  }

  /* Forms */
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  /* Auth forms */
  .auth-form .form-group {
    margin-bottom: 16px;
  }

  /* CTA Banner */
  .instagram-banner {
    padding: 50px 0;
  }

  .instagram-banner h2 {
    font-size: 1.75rem;
  }

  /* Footer */
  .footer {
    padding: 40px 0 0;
  }

  .footer-col h4 {
    font-size: 1rem;
  }

  .footer-col a {
    font-size: 0.85rem;
  }

  .footer-bottom {
    font-size: 0.8rem;
  }

  /* Modals */
  .modal-content-sm {
    max-width: 100%;
  }

  .modal-header h2 {
    font-size: 1.1rem;
  }

  .auth-message-body {
    padding: 24px 16px;
  }

  .auth-message-icon {
    font-size: 3rem;
  }

  /* Devis cards */
  .devis-card {
    padding: 1rem;
  }
}

/* ===== HAMBURGER MENU ===== */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--secondary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5.5px, 5.5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5.5px, -5.5px);
}

/* Overlay nav on mobile */
.mobile-actions { display: none; }
.mobile-lang { display: none; }

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  #navLinks {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 80px 24px 40px;
    overflow-y: auto;
  }

  #navLinks.open {
    opacity: 1;
    visibility: visible;
  }

  #navLinks a {
    font-size: 1.2rem;
    padding: 10px 0;
    color: var(--text-dark);
    font-weight: 700;
  }

  #navLinks a.active::after { display: none; }

  #navLinks a:hover { color: var(--primary); }

  .mobile-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 260px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
  }

  .mobile-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
  }

  .mobile-actions .auth-user-info {
    flex-direction: column;
    text-align: center;
  }

  .mobile-lang {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 260px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
  }

  .mobile-lang select {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 0.95rem;
    cursor: pointer;
    background: var(--white);
    color: var(--text-dark);
  }

  /* Style lang-selector inside overlay (app.html) */
  #navLinks > .lang-selector {
    display: flex;
    width: 100%;
    max-width: 260px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    justify-content: center;
  }

  #navLinks > .lang-selector select {
    flex: 1;
  }
}

/* ===== SCROLL TO TOP ===== */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 107, 0, 0.4);
  transition: var(--transition);
  z-index: 99;
  display: none;
}

.scroll-to-top.visible {
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(255, 107, 0, 0.5);
}

/* ===== SMOOTH SCROLLING ===== */
html {
  scroll-behavior: smooth;
}

/* ===== APP SIDEBAR LAYOUT ===== */
.app-container {
  display: flex;
  min-height: calc(100vh - 120px);
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  gap: 0;
}

.app-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid #e5e7eb;
  padding: 24px 0;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-menu a i {
  width: 20px;
  text-align: center;
  color: var(--text-light);
  font-size: 1.1rem;
}

.sidebar-menu a:hover {
  background: rgba(255, 107, 0, 0.05);
  color: var(--primary);
}

.sidebar-menu a:hover i {
  color: var(--primary);
}

.sidebar-menu a.active {
  background: rgba(255, 107, 0, 0.08);
  color: var(--primary);
  border-left-color: var(--primary);
}

.sidebar-menu a.active i {
  color: var(--primary);
}

.app-main {
  flex: 1;
  padding: 32px;
  background: var(--bg-light);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.app-header h1 {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--secondary);
}

/* Empty state for requests */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.empty-state i {
  font-size: 3.5rem;
  color: var(--text-light);
  opacity: 0.4;
  margin-bottom: 20px;
}

.empty-state h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-light);
  font-size: 1rem;
  max-width: 400px;
  margin: 0 auto;
}

/* ===== DATA TABLES (for Requests & Invoices views) ===== */
.data-table {
  overflow-x: auto;
}

.data-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table thead {
  background: #f8fafc;
}

.data-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  color: #475569;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e5e7eb;
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
  color: #334155;
}

.data-table tbody tr {
  transition: background 0.3s ease;
}

.data-table tbody tr:hover {
  background: #f8fafc;
}

/* ===== STATUS BADGES ===== */
.status-badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #e5e7eb;
  color: #475569;
}

.status-review {
  background: #fef3c7;
  color: #92400e;
}

.status-progress {
  background: #dbeafe;
  color: #1e40af;
}

.status-completed {
  background: #d1fae5;
  color: #065f46;
}

.status-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

/* ===== ACTION BUTTONS ===== */
.btn-view {
  background: #f97316;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-view:hover {
  background: #ea580c;
  transform: scale(1.05);
}

.btn-download {
  background: var(--white);
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}

.btn-download:hover {
  background: var(--primary);
  color: var(--white);
}

.payment-paid {
  color: #065f46;
  font-weight: 600;
}

.payment-pending {
  color: #92400e;
  font-weight: 600;
}

.payment-overdue {
  color: #991b1b;
  font-weight: 600;
}

/* Sidebar responsive */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
    padding: 0;
  }

  .app-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 0;
    overflow-x: auto;
  }

  .sidebar-menu {
    flex-direction: row;
  }

  .sidebar-menu a {
    white-space: nowrap;
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: 12px 16px;
  }

  .sidebar-menu a.active {
    border-left-color: transparent;
    border-bottom-color: var(--primary);
  }

  .app-main {
    padding: 16px;
  }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 968px) {
  .hero .container {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero-content {
    max-width: 100%;
    text-align: center;
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .header-actions {
    display: none;
  }

  .hero {
    padding: 40px 0;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
  }
  
  .steps-grid,
  .benefits-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .instagram-banner h2 {
    font-size: 1.8rem;
  }
  
  .section {
    padding: 48px 0;
  }
}



/* ===== RESPONSIVE: DATA TABLES to CARDS ===== */
@media (max-width: 768px) {
  .data-table table,
  .data-table thead,
  .data-table tbody,
  .data-table th,
  .data-table td,
  .data-table tr {
    display: block;
  }
  .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  .data-table tbody tr {
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    padding: 16px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
  }
  .data-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px;
    border-bottom: 1px solid #f1f5f9;
    text-align: right;
    gap: 12px;
  }
  .data-table tbody td:last-child {
    border-bottom: none;
  }
  .data-table tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-light);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
  }
  .data-table tbody td:empty::before { display: none; }
  .data-table th:empty { display: none; }
}

/* ===== RESPONSIVE: SMALL SCREEN REFINEMENTS ===== */
@media (max-width: 576px) {
  .container { padding: 0 12px; }
  .hero { padding: 32px 0 24px; }
  .hero h1 { font-size: 1.5rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-image-wrapper img { max-width: 70%; }
  .section { padding: 40px 0; }
  .section-title { font-size: 1.5rem; margin-bottom: 12px; }
  .section-subtitle { font-size: 0.9rem; margin-bottom: 32px; }
  .service-image { height: 160px; }
  .card-body { padding: 16px; }
  .card-body h3 { font-size: 1rem; }
  .step-card { padding: 24px 20px; }
  .step-icon { width: 60px; height: 60px; font-size: 1.8rem; }
  .benefit-card { padding: 24px 20px; }
  .instagram-banner { padding: 40px 0; }
  .instagram-banner h2 { font-size: 1.5rem; }
  .instagram-banner p { font-size: 0.95rem; }
  .footer { padding: 32px 0 0; }
  .footer-grid { gap: 20px; }
  .app-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .app-header h1 { font-size: 1.3rem; }
  .app-main { padding: 12px; }
  .app-sidebar { padding: 12px 0; }
  .sidebar-menu a { padding: 10px 16px; font-size: 0.85rem; }
  .modal-content { max-width: 100%; margin: 0 8px; max-height: 95vh; }
  .modal-header { padding: 14px 16px; }
  .modal-header h2 { font-size: 1.1rem; }
  .modal-body { padding: 14px 16px; }
  .auth-message-body { padding: 20px 16px; }
  .auth-message-icon { font-size: 2.5rem; }
  .empty-state { padding: 40px 16px; }
  .empty-state i { font-size: 2.5rem; }
  .empty-state h3 { font-size: 1.1rem; }
  .file-preview-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
  .upload-area { padding: 20px 16px; }
  .upload-icon { font-size: 1.8rem; }
  .btn { padding: 10px 18px; font-size: 0.85rem; }
  .scroll-to-top { width: 40px; height: 40px; font-size: 1rem; bottom: 20px; right: 20px; }
  .devis-card { flex-direction: column; text-align: center; padding: 1rem; }
  .devis-card .devis-actions { width: 100%; justify-content: center; }
}

/* ===== RESPONSIVE: EXTRA SMALL (320px-414px) ===== */
@media (max-width: 414px) {
  .hero h1 { font-size: 1.35rem; }
  .hero-subtitle { font-size: 0.7rem; padding: 4px 12px; }
  .hero-description { font-size: 0.85rem; }
  .logo-text { font-size: 0.85rem; }
  .logo-icon { width: 36px; height: 36px; font-size: 1.1rem; }
  .section-title { font-size: 1.3rem; }
  .service-image { height: 140px; }
  .card-body { padding: 14px; }
  .card-body h3 { font-size: 0.95rem; }
  .card-body p { font-size: 0.85rem; }
  .form-group input, .form-group select, .form-group textarea { padding: 10px 12px; font-size: 0.85rem; }
  .form-group label { font-size: 0.85rem; }
  .step-card h3 { font-size: 1.1rem; }
  .benefit-card h3 { font-size: 1.1rem; }
  .footer-col h4 { font-size: 0.95rem; }
  .footer-col a { font-size: 0.8rem; }
  .app-header h1 { font-size: 1.1rem; }
}

/* ===== RESPONSIVE: 320px specific ===== */
@media (max-width: 320px) {
  .container { padding: 0 8px; }
  .logo-text { font-size: 0.75rem; }
  .logo-image { width: 36px; height: 36px; }
  .hero h1 { font-size: 1.2rem; }
  .hero-description { font-size: 0.8rem; }
  .top-bar { display: none; }
}

/* ===== TOUCH-FRIENDLY SIZING ===== */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .form-group input,
  .form-group select,
  .form-group textarea { min-height: 44px; font-size: 16px; }
  .lang-selector select { min-height: 44px; font-size: 16px; }
  .sidebar-menu a { padding: 14px 20px; }
  .service-card { cursor: pointer; }
  .modal-close { width: 44px; height: 44px; }
}

/* ===== PREVENT HORIZONTAL OVERFLOW ===== */
body, html {
  overflow-x: hidden;
  width: 100%;
}
img, video, canvas, svg, iframe {
  max-width: 100%;
  height: auto;
}
pre, code, .data-table {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table { max-width: 100%; }

/* ===== RTL SPECIFIC OVERRIDES FOR ICONS ===== */
html[dir="rtl"] .fa-arrow-right,
html[dir="rtl"] .fa-chevron-right,
html[dir="rtl"] .fa-sign-in-alt,
html[dir="rtl"] .fa-sign-out-alt {
    transform: scaleX(-1);
}

/* ===== RTL OVERRIDES FOR APP SIDEBAR LAYOUT ===== */
html[dir="rtl"] .app-sidebar {
  border-right: none;
  border-left: 1px solid #e5e7eb;
}

html[dir="rtl"] .sidebar-menu a {
  border-left: none;
  border-right: 3px solid transparent;
}

html[dir="rtl"] .sidebar-menu a.active {
  border-left-color: transparent;
  border-right-color: var(--primary);
}

html[dir="rtl"] .data-table th {
  text-align: right;
}

@media (max-width: 768px) {
  html[dir="rtl"] .app-sidebar {
    border-left: none;
    border-bottom: 1px solid #e5e7eb;
  }
  html[dir="rtl"] .sidebar-menu a {
    border-right: none;
    border-bottom: 3px solid transparent;
  }
  html[dir="rtl"] .sidebar-menu a.active {
    border-right-color: transparent;
    border-bottom-color: var(--primary);
  }
}

/* ===== FILL VIEWPORT FOR APP VIEWS ===== */
.app-main > div[id] {
  flex: 1;
}

/* ===== MODAL LOADING OVERLAY ===== */
.modal-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: var(--radius-lg);
}

.modal-loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #ff6b00;
  border-radius: 50%;
  animation: modalSpin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes modalSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.modal-loading-text {
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}
