/* ============================================
   Financial Connect - Enhanced Stylesheet
   ============================================ */

/* === CSS Variables === */
:root {
  --brand-primary: #0f766e;
  --brand-light: #14b8a6;
  --brand-dark: #0d5c55;
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* === Base Styles === */
* {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.ar {
  font-family: 'Tajawal', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

/* === Accessibility === */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--brand-primary);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
  border-radius: 4px;
}

.skip-link:focus {
  top: 0;
}

:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* === Top Bar === */
.top-bar {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-dark) 100%);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* === Header === */
.header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: all var(--transition-base);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
}

.logo-container {
  width: 3.5rem;
  height: 3.5rem;
  display: grid;
  place-items: center;
  border-radius: 1rem;
  background: white;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.logo-container:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.logo-img {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
}

.nav-link {
  position: relative;
  color: #475569;
  font-weight: 500;
  padding: 0.5rem 0;
  transition: color var(--transition-base);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand-primary);
  transition: width var(--transition-base);
}

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

.nav-link:hover::after {
  width: 100%;
}

.menu-toggle {
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all var(--transition-base);
}

.menu-toggle:hover {
  background: #f1f5f9;
}

.menu-toggle:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.mobile-nav {
  padding: 1rem 0;
  animation: slideDown 0.3s ease-out;
}

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

.mobile-nav-link {
  display: block;
  padding: 0.75rem 0;
  color: #475569;
  font-weight: 500;
  transition: all var(--transition-base);
  border-bottom: 1px solid #f1f5f9;
}

.mobile-nav-link:hover {
  color: var(--brand-primary);
  padding-left: 0.5rem;
}

[dir="rtl"] .mobile-nav-link:hover {
  padding-left: 0;
  padding-right: 0.5rem;
}

/* === Buttons === */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all var(--transition-base);
  text-decoration: none;
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-light) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: white;
  color: var(--brand-primary);
  border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: #f0fdfa;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* === Hero Section === */
.hero-section {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(15, 118, 110, 0.05) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(20, 184, 166, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 10;
}

.hero-title {
  background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-image-container {
  position: relative;
}

.hero-image-wrapper {
  position: relative;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  margin-bottom: 1.5rem;
  transition: transform var(--transition-base);
}

.hero-image-wrapper:hover {
  transform: translateY(-4px);
}

.hero-image {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

.hero-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-radius: 1.5rem;
  border: 1px solid #e2e8f0;
  background: white;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-card {
  padding: 1.5rem;
  border-right: 1px solid #e2e8f0;
}

[dir="rtl"] .hero-card {
  border-right: none;
  border-left: 1px solid #e2e8f0;
}

.hero-card:last-child {
  border-right: none;
}

[dir="rtl"] .hero-card:last-child {
  border-left: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  transition: all var(--transition-base);
}

.badge:hover {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  transform: translateY(-2px);
}

/* === Sections === */
.section {
  padding: 5rem 0;
  position: relative;
}

.section-white {
  background: white;
}

.section-header {
  text-align: center;
  max-width: 3xl;
  margin: 0 auto 3rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.section-subtitle {
  font-size: 1.125rem;
  color: #64748b;
  max-width: 42rem;
  margin: 0 auto;
}

/* === Reveal Animation === */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

/* === Service Cards === */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.service-card {
  padding: 2rem;
  border-radius: 1.5rem;
  border: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-primary) 0%, var(--brand-light) 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--brand-light);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.service-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.75rem;
}

.service-card-description {
  font-size: 0.9375rem;
  color: #64748b;
  line-height: 1.6;
}

/* === Industry Cards === */
.industries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.industry-card {
  padding: 2rem;
  border-radius: 1.5rem;
  border: 1px solid #e2e8f0;
  background: white;
  transition: all var(--transition-base);
}

.industry-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-light);
}

.industry-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.industry-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.75rem;
}

.industry-card-description {
  font-size: 0.9375rem;
  color: #64748b;
  line-height: 1.6;
}

/* === Why Cards === */
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.why-card {
  padding: 2rem;
  border-radius: 1.5rem;
  border: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  transition: all var(--transition-base);
  text-align: center;
}

.why-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-light);
}

.why-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.why-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.75rem;
}

.why-card-description {
  font-size: 0.9375rem;
  color: #64748b;
  line-height: 1.6;
}

/* === Pricing Section === */
.pricing-section {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.pricing-card {
  position: relative;
  padding: 2.5rem 2rem;
  border-radius: 1.5rem;
  border: 2px solid #e2e8f0;
  background: white;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}

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

.pricing-card-featured {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-xl);
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .pricing-card-featured {
    transform: scale(1);
  }
}

.pricing-card-featured:hover {
  transform: scale(1.05) translateY(-8px);
}

.featured-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-light) 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pricing-header {
  margin-bottom: 1.5rem;
}

.pricing-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.75rem;
}

.pricing-card-description {
  font-size: 0.9375rem;
  color: #64748b;
  line-height: 1.6;
}

.pricing-price {
  font-size: 3rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 2rem;
  line-height: 1;
}

.pricing-period {
  font-size: 1.25rem;
  font-weight: 500;
  color: #64748b;
}

.pricing-note {
  text-align: center;
  font-size: 0.875rem;
  color: #94a3b8;
  margin-top: 2rem;
}

/* === Contact Section === */
.contact-section {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.contact-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

@media (max-width: 1024px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.contact-form-container {
  padding: 2rem;
  border-radius: 1.5rem;
  border: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--shadow-md);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.form-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1e293b;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 2px solid #e2e8f0;
  font-size: 0.9375rem;
  transition: all var(--transition-base);
  font-family: inherit;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.form-input:invalid:not(:placeholder-shown),
.form-textarea:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

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

.form-status {
  font-size: 0.875rem;
  color: #64748b;
  text-align: center;
}

.form-status.success {
  color: #10b981;
  font-weight: 600;
}

.form-status.error {
  color: #ef4444;
  font-weight: 600;
}

.contact-details {
  padding: 2rem;
  border-radius: 1.5rem;
  border: 1px solid #e2e8f0;
  background: white;
  box-shadow: var(--shadow-md);
  height: fit-content;
  position: sticky;
  top: 6rem;
}

@media (max-width: 1024px) {
  .contact-details {
    position: static;
  }
}

.contact-details-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1.5rem;
}

.contact-details-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-details-list li {
  font-size: 0.9375rem;
  color: #475569;
  line-height: 1.6;
}

.contact-details-list strong {
  color: #1e293b;
  font-weight: 600;
  display: block;
  margin-bottom: 0.25rem;
}

.contact-link {
  color: var(--brand-primary);
  text-decoration: none;
  transition: all var(--transition-base);
}

.contact-link:hover {
  text-decoration: underline;
  color: var(--brand-dark);
}

.contact-note {
  font-size: 0.75rem;
  color: #94a3b8;
  font-style: italic;
}

/* === Footer === */
.footer {
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
  border-top: 1px solid #cbd5e1;
}

.footer-link {
  color: #64748b;
  text-decoration: none;
  transition: color var(--transition-base);
}

.footer-link:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}

/* === Back to Top Button === */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-light) 100%);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
  z-index: 40;
}

[dir="rtl"] .back-to-top {
  right: auto;
  left: 2rem;
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.back-to-top:active {
  transform: translateY(-2px);
}

/* === Responsive Design === */
@media (max-width: 768px) {
  .section {
    padding: 3rem 0;
  }

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

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

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

  .services-grid,
  .industries-grid,
  .why-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .hero-cards {
    grid-template-columns: 1fr;
  }

  .hero-card {
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }

  .hero-card:last-child {
    border-bottom: none;
  }

  .contact-form-container,
  .contact-details {
    padding: 1.5rem;
  }
}

@media (max-width: 640px) {
  .btn-large {
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
  }

  .back-to-top {
    width: 2.5rem;
    height: 2.5rem;
    bottom: 1rem;
    right: 1rem;
  }

  [dir="rtl"] .back-to-top {
    left: 1rem;
  }
}

/* === Print Styles === */
@media print {
  .header,
  .top-bar,
  .back-to-top,
  .mobile-nav {
    display: none;
  }

  .section {
    page-break-inside: avoid;
  }
}

/* === Reduced 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;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

