/* ==========================================================================
   ProcomTech - RTL Arabic Landing Page Stylesheet
   ========================================================================== */

:root {
  --primary: #104A85;
  --primary-hover: #0c3b6d;
  --primary-active: #092f58;
  --primary-subtle: #eff6ff;
  --primary-border: #bfdbfe;
  
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  
  --text-dark: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --border-light: #e2e8f0;
  --border-focus: #104A85;
  
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --success: #10b981;
  --success-bg: #ecfdf5;

  --font-family: 'Tajawal', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-title: 'Cairo', 'Tajawal', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-video: 25px;
  --radius-card: 16px;
  --radius-input: 12px;
  --radius-btn: 10px;

  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base & Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-body);
  line-height: 1.6;
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   1. HEADER
   ========================================================================== */
.main-header {
  width: 100%;
  height: 90px;
  background-color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px -2px rgba(16, 74, 133, 0.22);
  position: relative;
  z-index: 50;
}

.header-container {
  width: 100%;
  max-width: 1200px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform var(--transition-fast);
}

.logo-link:hover {
  transform: scale(1.02);
}

.brand-logo {
  height: 44px;
  width: auto;
  max-width: 220px;
  display: block;
  object-fit: contain;
}

/* ==========================================================================
   PAGE LAYOUT & CONTAINER
   ========================================================================== */
.page-content {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 20px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ==========================================================================
   2. VIDEO SECTION
   ========================================================================== */
.video-section {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 36px;
  animation: fadeIn 0.8s ease-out;
}

.video-container {
  width: 100%;
  max-width: 600px;
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background-color: #0f172a;
  border-radius: var(--radius-video);
  overflow: hidden;
  box-shadow: 0 12px 32px -4px rgba(16, 74, 133, 0.22),
              0 0 0 1px rgba(16, 74, 133, 0.12);
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.video-wrapper:hover {
  box-shadow: 0 16px 40px -4px rgba(16, 74, 133, 0.28),
              0 0 0 1.5px rgba(16, 74, 133, 0.2);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius-video);
}

/* ==========================================================================
   3. LEAD GENERATION FORM
   ========================================================================== */
.form-section {
  width: 100%;
  display: flex;
  justify-content: center;
  animation: fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-card {
  width: 100%;
  max-width: 560px;
  background-color: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 36px 36px 32px;
  box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.05),
              0 1px 3px 0 rgba(0, 0, 0, 0.02),
              0 0 0 1px var(--border-light);
}

.form-header {
  text-align: center;
  margin-bottom: 28px;
}

.form-title {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.3;
  margin-bottom: 8px;
}

.form-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Form Grid & Layout */
.lead-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.form-row.full-width {
  grid-template-columns: 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
  position: relative;
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.required-star {
  color: var(--danger);
  font-weight: 700;
}

.input-wrapper {
  position: relative;
  width: 100%;
}

.form-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-family: var(--font-family);
  font-size: 14.5px;
  color: var(--text-dark);
  background-color: #fafbfc;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-input);
  outline: none;
  transition: all var(--transition-fast);
  text-align: right;
}

.form-input::placeholder {
  color: var(--text-light);
  font-size: 13.5px;
  font-weight: 400;
}

.form-input:hover {
  border-color: #cbd5e1;
  background-color: #ffffff;
}

.form-input:focus {
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3.5px rgba(16, 74, 133, 0.12);
}

/* Phone input special LTR adjustment with Arabic friendly UI */
.form-input[type="tel"] {
  text-align: right;
}
.form-input[type="tel"]:focus,
.form-input[type="tel"]:not(:placeholder-shown) {
  text-align: left;
  direction: ltr;
}

/* Error States */
.form-group.has-error .form-input {
  border-color: var(--danger);
  background-color: var(--danger-bg);
}

.form-group.has-error .form-input:focus {
  box-shadow: 0 0 0 3.5px rgba(239, 68, 68, 0.15);
}

.error-msg {
  display: none;
  font-size: 12.5px;
  color: var(--danger);
  font-weight: 500;
  margin-top: 5px;
  animation: fadeIn 0.2s ease;
}

.form-group.has-error .error-msg {
  display: block;
}

/* ==========================================================================
   4. CTA BUTTON
   ========================================================================== */
.form-actions {
  margin-top: 8px;
}

.cta-button {
  width: 100%;
  height: 55px;
  background-color: var(--primary);
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 17px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(16, 74, 133, 0.28);
  transition: all var(--transition-normal);
  position: relative;
  user-select: none;
}

.cta-button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(16, 74, 133, 0.35);
}

.cta-button:active {
  transform: translateY(0);
  background-color: var(--primary-active);
  box-shadow: 0 3px 10px rgba(16, 74, 133, 0.25);
}

.cta-button:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Spinner */
.btn-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.7s linear infinite;
}

.privacy-note {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 14px;
}

/* ==========================================================================
   SUBMISSION ERROR BANNER
   ========================================================================== */
.form-error-banner {
  background-color: var(--danger-bg);
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  padding: 12px 16px;
  border-radius: var(--radius-input);
  margin-bottom: 18px;
  animation: fadeIn 0.25s ease;
}

/* ==========================================================================
   THANK-YOU PAGE
   ========================================================================== */
.thankyou-page {
  justify-content: center;
  padding-top: 56px;
}

.thankyou-section {
  width: 100%;
  display: flex;
  justify-content: center;
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.thankyou-card {
  width: 100%;
  max-width: 560px;
  background-color: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 44px 40px 36px;
  text-align: center;
  box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.05),
              0 1px 3px 0 rgba(0, 0, 0, 0.02),
              0 0 0 1px var(--border-light);
}

.thankyou-icon-wrapper {
  width: 84px;
  height: 84px;
  background-color: var(--success-bg);
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
  box-shadow: 0 0 0 10px rgba(16, 185, 129, 0.09);
  animation: scaleUp 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Draw the circle, then the check mark */
.check-circle {
  stroke-dasharray: 145;
  stroke-dashoffset: 145;
  animation: drawStroke 0.6s 0.15s ease-out forwards;
}

.check-mark {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: drawStroke 0.35s 0.6s ease-out forwards;
}

.thankyou-title {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.35;
  margin-bottom: 10px;
}

.thankyou-lead {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.thankyou-desc {
  font-size: 15px;
  color: var(--text-body);
  line-height: 1.75;
  max-width: 420px;
  margin: 0 auto;
}

.thankyou-desc strong {
  color: var(--text-dark);
  font-weight: 700;
}

/* Next steps list */
.next-steps {
  text-align: right;
  background-color: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-input);
  padding: 20px 22px;
  margin: 28px 0 26px;
}

.next-steps-title {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 14px;
}

.steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.step-num {
  flex-shrink: 0;
  width: 25px;
  height: 25px;
  background-color: var(--primary);
  color: #ffffff;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.step-text {
  font-size: 14.5px;
  color: var(--text-body);
  line-height: 1.55;
}

.thankyou-actions {
  margin-top: 4px;
}

/* The CTA styled as an anchor on the thank-you page */
.cta-button-link {
  text-decoration: none;
  height: 52px;
}

.thankyou-contact {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 18px;
}

.thankyou-contact a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.thankyou-contact a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.main-footer {
  width: 100%;
  padding: 24px 20px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-light);
  border-top: 1px solid var(--border-light);
  background-color: #ffffff;
  margin-top: auto;
}

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes drawStroke {
  to {
    stroke-dashoffset: 0;
  }
}

/* Respect users who ask for less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .check-circle,
  .check-mark {
    stroke-dashoffset: 0;
  }
}

/* ==========================================================================
   7. RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================================== */
@media (max-width: 768px) {
  .main-header {
    height: 80px;
  }
  
  .brand-logo {
    height: 38px;
  }

  .page-content {
    padding: 24px 16px 36px;
  }

  .video-section {
    margin-bottom: 28px;
  }

  .video-wrapper {
    border-radius: 20px;
  }

  .form-card {
    padding: 28px 22px 26px;
  }

  .form-title {
    font-size: 23px;
  }

  .form-subtitle {
    font-size: 14px;
  }

  .thankyou-page {
    padding-top: 36px;
  }

  .thankyou-card {
    padding: 36px 26px 30px;
  }

  .thankyou-title {
    font-size: 25px;
  }
}

@media (max-width: 580px) {
  .main-header {
    height: 75px;
  }

  .brand-logo {
    height: 34px;
  }

  .page-content {
    padding: 18px 12px 28px;
  }

  .video-section {
    margin-bottom: 22px;
  }

  .video-wrapper {
    border-radius: 16px;
  }

  .video-wrapper iframe {
    border-radius: 16px;
  }

  .form-card {
    padding: 22px 16px 20px;
    border-radius: 14px;
  }

  .form-row {
    grid-template-columns: 1fr; /* Stack all fields vertically */
    gap: 14px;
  }

  .form-title {
    font-size: 21px;
  }

  .form-subtitle {
    font-size: 13.5px;
  }

  .cta-button {
    height: 52px;
    font-size: 16px;
  }

  .thankyou-page {
    padding-top: 26px;
  }

  .thankyou-card {
    padding: 30px 18px 24px;
    border-radius: 14px;
  }

  .thankyou-icon-wrapper {
    width: 72px;
    height: 72px;
    margin-bottom: 18px;
  }

  .thankyou-title {
    font-size: 22px;
  }

  .thankyou-lead {
    font-size: 15.5px;
  }

  .thankyou-desc {
    font-size: 14.5px;
  }

  .next-steps {
    padding: 16px 16px;
    margin: 24px 0 22px;
  }

  .step-text {
    font-size: 14px;
  }
}
