.back-to-top {
  position: fixed;
  bottom: calc(2rem + var(--back-to-top-lift, 0px));
  right: 2rem;
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: 0;
  width: 50px;
  height: 50px;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  z-index: 1000;
  box-shadow: var(--box-shadow-lg);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--color-primary);
  transform: translateY(-2px);
}

@keyframes vienna-fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.service-card,
.service-detail-row,
.feature {
  animation: vienna-fade-in-up 0.6s ease backwards;
}

.service-card:nth-child(1), .service-detail-row:nth-child(1), .feature:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2), .service-detail-row:nth-child(2), .feature:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3), .service-detail-row:nth-child(3), .feature:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4), .service-detail-row:nth-child(4), .feature:nth-child(4) { animation-delay: 0.4s; }
.service-card:nth-child(5), .service-detail-row:nth-child(5), .feature:nth-child(5) { animation-delay: 0.5s; }
.service-card:nth-child(6), .service-detail-row:nth-child(6), .feature:nth-child(6) { animation-delay: 0.6s; }
.service-card:nth-child(7), .service-detail-row:nth-child(7), .feature:nth-child(7) { animation-delay: 0.7s; }
.service-card:nth-child(8), .service-detail-row:nth-child(8), .feature:nth-child(8) { animation-delay: 0.8s; }

.menu-toggle {
  display: inline-flex;
}

@media (min-width: 769px) {
  .menu-toggle {
    display: none;
  }
}

.menu-toggle.active {
  transform: none;
}

.menu-toggle i {
  transition: var(--transition);
}

.btn.loading {
  position: relative;
  pointer-events: none;
}

.btn.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  margin-left: -8px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 0;
  animation: spin 1s linear infinite;
}

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

.form-group {
  position: relative;
  margin-bottom: var(--spacing-lg);
}

.form-group.focused label {
  transform: translateY(-20px) scale(0.8);
  color: var(--color-primary);
}

.form-group label {
  position: absolute;
  top: 0;
  left: 0;
  padding: var(--spacing-sm);
  pointer-events: none;
  transition: var(--transition);
  color: var(--color-text-light);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--spacing-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background-color: white;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-primary);
  box-shadow: none;
}

.service-card {
  transition: all 0.3s ease;
  will-change: transform;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: calc(1rem + var(--back-to-top-lift, 0px));
    right: 1rem;
    width: 45px;
    height: 45px;
    font-size: 1rem;
  }
}

@media (prefers-contrast: high) {
  :root {
    --color-primary: #000080;
    --color-secondary: #0066cc;
    --color-text: #000000;
    --color-background: #ffffff;
    --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }

  .btn {
    border: 2px solid currentColor;
  }

  .service-card {
    border: 1px solid var(--color-border);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-section {
    transform: none !important;
  }

  .service-card,
  .feature {
    opacity: 1 !important;
    transform: none !important;
  }
}

.theme-light .site-header,
.theme-light .site-main,
.theme-light body {
  background-color: var(--color-background);
  color: var(--color-text);
}

.theme-light .site-header {
  border-bottom: none;
}

.theme-light .contact-info,
.theme-light .about-section,
.theme-light .locations-section,
.theme-light .services-detail-section,
.theme-light .service-detail-row.bg-light,
.theme-light .bg-light,
.theme-light .service-content {
  background-color: var(--color-background);
}

.theme-light .service-detail-row.bg-secondary,
.theme-light .bg-secondary {
  background-color: var(--color-background-light);
}

.theme-light .main-navigation a,
.theme-light .site-title a,
.theme-light .site-description {
  color: var(--color-text);
}

.theme-light .main-navigation .menu > li > a:hover,
.theme-light .main-navigation .menu > li > a:focus {
  color: var(--color-text);
  background-color: transparent;
  text-decoration: underline;
}

.theme-light .entry-content,
.theme-light .entry-summary,
.theme-light .entry-meta,
.theme-light .page-content {
  color: var(--color-text);
}

.theme-light .widget {
  background-color: var(--color-background);
  border: 1px solid var(--color-border);
}

.theme-light .widget-title {
  color: var(--color-text);
}

.theme-light input[type="text"],
.theme-light input[type="email"],
.theme-light input[type="url"],
.theme-light input[type="password"],
.theme-light input[type="search"],
.theme-light input[type="number"],
.theme-light input[type="tel"],
.theme-light input[type="range"],
.theme-light input[type="date"],
.theme-light input[type="month"],
.theme-light input[type="week"],
.theme-light input[type="time"],
.theme-light input[type="datetime"],
.theme-light input[type="datetime-local"],
.theme-light input[type="color"],
.theme-light textarea,
.theme-light select {
  background-color: var(--color-background);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

@media print {
  .back-to-top,
  .menu-toggle {
    display: none !important;
  }

  .service-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .hero-section {
    background: none !important;
    color: black !important;
  }

  .cta-section {
    background: none !important;
    color: black !important;
  }

  .btn {
    border: 1px solid black;
    color: black !important;
    background: none !important;
  }
}

.floating-phone-widget {
  --phone-size: 70px;
  position: fixed;
  top: 25%;
  right: 0;
  transform: translateY(calc(var(--phone-size) * -0.25));
  z-index: 9999;
  font-family: var(--font-family-primary);
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  border-radius: 0;
  box-shadow: -3px 0 10px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  opacity: 1;
  cursor: pointer;
  color: white;
  overflow: hidden;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.floating-phone-widget.expanded {
  width: 250px;
  padding: 0 22px 0 18px;
  justify-content: flex-start;
  border-radius: 0;
}

.floating-phone-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  font-size: 20px;
  min-width: 35px;
  height: 35px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.floating-phone-widget:not(.expanded) .floating-phone-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.floating-phone-widget.expanded .floating-phone-icon {
  position: relative;
  transform: none;
  left: auto;
  top: auto;
}

.floating-phone-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-20px);
  transition: all 0.3s ease;
  white-space: nowrap;
  margin-left: 18px;
}

.floating-phone-widget:not(.expanded) .floating-phone-content {
  display: none;
}

.floating-phone-widget.expanded .floating-phone-content {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.floating-phone-info {
  line-height: 1.25;
}

.floating-phone-number {
  color: white;
  font-weight: var(--font-weight-semibold);
  font-size: 17px;
  text-decoration: none;
}

.floating-phone-number:hover {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.floating-phone-label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

@media (max-width: 768px) {
  .floating-phone-widget {
    --phone-size: 68px;
    top: 48%;
    bottom: auto;
    right: 0;
    width: 68px;
    height: 68px;
    border-radius: 0;
  }

  .floating-phone-widget.expanded {
    width: 200px;
    padding: 0 16px;
    border-radius: 0;
  }

  .floating-phone-icon {
    font-size: 18px;
    min-width: 24px;
    height: 24px;
  }

  .floating-phone-widget:not(.expanded) .floating-phone-icon {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  .floating-phone-content {
    margin-left: 10px;
  }

  .floating-phone-number {
    font-size: 14px;
  }

  .floating-phone-label {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .floating-phone-widget {
    --phone-size: 52px;
    top: 25%;
    bottom: auto;
    right: 15px;
    width: 52px;
    height: 52px;
    border-radius: 0;
  }

  .floating-phone-widget.expanded {
    width: 200px;
    height: 62px;
    padding: 0 14px;
    transform: translateY(calc(var(--phone-size) * -0.25 - 10px));
    border-radius: 0;
  }

  .floating-phone-icon {
    font-size: 16px;
    min-width: 22px;
    height: 22px;
  }

  .floating-phone-widget:not(.expanded) .floating-phone-icon {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  .floating-phone-number {
    font-size: 13px;
  }

  .floating-phone-label {
    font-size: 11px;
  }
}

@media print {
  .floating-phone-widget {
    display: none !important;
  }
}

.service-card-link {
  transition: all 0.3s ease;
}

.service-card-link:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .service-card-link:hover {
    transform: none;
    box-shadow: inherit;
  }
}

.floating-apply-widget,
.floating-apply-widget:visited,
.floating-apply-widget:hover,
.floating-apply-widget:focus,
.floating-apply-widget:active {
  color: white;
  text-decoration: none;
}

.floating-apply-widget {
  position: fixed;
  top: calc(25% + 66px);
  right: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  width: 70px;
  height: 70px;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  box-shadow: -3px 0 10px rgba(0, 0, 0, 0.2);
  font-family: var(--font-family-primary);
  transition: width 0.3s ease, padding 0.3s ease;
}

.floating-apply-widget:hover,
.floating-apply-widget:focus-visible {
  width: 300px;
  padding: 0 22px 0 18px;
}

.floating-apply-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 70px;
  height: 70px;
  font-size: 20px;
  color: white;
  transition: width 0.3s ease;
}

.floating-apply-widget:hover .floating-apply-icon,
.floating-apply-widget:focus-visible .floating-apply-icon {
  width: 35px;
  margin-right: 14px;
}

.floating-apply-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.25;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease 0.1s;
}

.floating-apply-widget:hover .floating-apply-content,
.floating-apply-widget:focus-visible .floating-apply-content {
  opacity: 1;
}

.floating-apply-title {
  font-weight: var(--font-weight-semibold);
  font-size: 16px;
  color: white;
}

.floating-apply-subtitle {
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 768px) {
  .floating-apply-widget,
  .floating-apply-widget:hover,
  .floating-apply-widget:focus-visible {
    top: calc(48% + 62px);
    width: 68px;
    height: 68px;
    padding: 0;
  }

  .floating-apply-content {
    display: none;
  }

  .floating-apply-icon,
  .floating-apply-widget:hover .floating-apply-icon {
    width: 68px;
    height: 68px;
    margin: 0;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .floating-apply-widget,
  .floating-apply-widget:hover,
  .floating-apply-widget:focus-visible {
    top: calc(25% + 50px);
    right: 15px;
    width: 52px;
    height: 52px;
  }

  .floating-apply-icon,
  .floating-apply-widget:hover .floating-apply-icon {
    width: 52px;
    height: 52px;
    font-size: 16px;
  }
}
