/* Modern popup styling with centered layout and square buttons */
.arhisoft-websitepopup-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(4px);
  padding: 20px;
  margin: 0;
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.arhisoft-websitepopup-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.arhisoft-websitepopup {
  background: #ffffff;
  border-radius: 8px; /* small rounded corners */
  padding: 40px; /* decreased padding */
  max-width: 760px; /* wider */
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-align: left; /* left align everything */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.4s ease;
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* left align content inside */
  justify-content: center; /* vertically center content */
  overflow: visible; /* allow dropdown menus to extend */
  box-sizing: border-box;
  max-height: 96vh; /* taller */
  min-height: 360px; /* ensure a bit more height */
  overflow-y: visible; /* avoid clipping dropdown vertically */
  -webkit-overflow-scrolling: touch;
  z-index: 2;
}

/* Inner white background */
.popup-content {
  background: #fff;
  border-radius: 0; /* match popup */
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
  padding: 0;
  box-sizing: border-box;
}

.popup-content {
  width: 100%;
  max-width: none; /* allow full width */
  margin: 0; /* remove center margin */
  padding: 0 0 0 0; /* no extra padding */
  box-sizing: border-box;
}

.arhisoft-websitepopup-backdrop.show .arhisoft-websitepopup {
  opacity: 1;
  animation: popupFadeIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@keyframes popupFadeIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.arhisoft-dropdown-menu {
  position: absolute;
  top: 100%; /* attach directly under toggle */
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px; /* small radius */
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
  max-height: 320px;
  overflow: auto;
  z-index: 100; /* above modal content */
  display: none;
}

.arhisoft-dropdown.open .arhisoft-dropdown-menu { 
  display: block; 
}

.arhisoft-websitepopup h2 { 
  margin: 0 0 16px; 
  font-size: 28px; 
  color: #1a1a1a;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.popup-subtitle { 
  margin: 0 0 32px; 
  color: #4a4a4a;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  opacity: 0.9;
}

.arhisoft-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  width: 100%;
  margin-top: 8px;
  justify-items: start; /* ensure left alignment of cells */
}

.arhisoft-dropdown { 
  position: relative; 
  width: 100%; 
}

.arhisoft-dropdown-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px; /* small radius */
  padding: 18px 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  cursor: pointer;
}

.arhisoft-dropdown-label { 
  font-size: 18px; 
  font-weight: 700; 
  color: #111827; 
}

.select-caret {
  display: inline-block;
  width: 10px; /* visual size driven by padding */
  height: 10px;
  border: solid #111827;
  border-width: 0 2px 2px 0; /* create an L shape */
  padding: 4px; /* arrow thickness/size */
  transform: rotate(45deg); /* Down arrow */
  -webkit-transform: rotate(45deg);
  transition: transform .2s ease;
}

.arhisoft-dropdown.open .select-caret {
  transform: rotate(-135deg);
  -webkit-transform: rotate(-135deg);
}

.arhisoft-dropdown.open .arhisoft-dropdown-toggle { 
  border-bottom-color: transparent; 
}

.arhisoft-dropdown.open .arhisoft-dropdown-menu { 
  border-top: 0; /* remove to avoid double line */
}

/* Remove radius between toggle and menu when expanded */
.arhisoft-dropdown.open .arhisoft-dropdown-toggle {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.arhisoft-dropdown.open .arhisoft-dropdown-menu {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* Hide the currently selected option when menu is open to avoid duplicate with label */
.arhisoft-dropdown.open .arhisoft-option.selected {
  display: none;
}

/* Add a single top divider to the first visible option when open */
.arhisoft-dropdown.open .arhisoft-dropdown-menu .arhisoft-option:first-child {
  border-top: 1px solid #e5e7eb;
}

.arhisoft-option {
  padding: 14px 16px;
  font-size: 18px;
  color: #111827;
  cursor: pointer;
  list-style: none;
}

.arhisoft-option + .arhisoft-option { 
  border-top: 1px solid #f0f0f0; 
}

.arhisoft-option:hover { 
  background: #f8f9fb; 
}

.arhisoft-option.selected { 
  font-weight: 700; 
}

.arhisoft-cta {
  background: #000;
  color: #fff;
  border: none;
  padding: 16px 36px; /* wider button */
  min-width: 200px; /* make button appear wider */
  border-radius: 2px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.arhisoft-cta:hover {
  background: #111;
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.28);
}

.arhisoft-cta:active {
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
}

.arhisoft-buttons { 
  display: grid; 
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 100%;
  margin-top: 10px;
}

.arhisoft-button {
  padding: 24px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  aspect-ratio: 1/1;
  position: relative;
  overflow: hidden;
  background: #f8fafc;
}

.button-icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 16px;
  display: block;
  transition: transform 0.25s ease;
}

.button-text {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

.arhisoft-button.primary { 
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.arhisoft-button.primary .button-text {
  color: #ffffff;
}

.arhisoft-button.primary:hover {
  background: #1d4ed8;
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.arhisoft-button.primary:hover .button-icon {
  transform: scale(1.1);
}

.arhisoft-button.secondary { 
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.arhisoft-button.secondary:hover {
  background: #f1f5f9;
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.arhisoft-button.secondary:hover .button-icon {
  transform: scale(1.1);
}

.arhisoft-close { 
  position: absolute; 
  right: 20px; 
  top: 20px; 
  cursor: pointer; 
  font-size: 24px;
  color: #94a3b8;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  background: #f1f5f9;
  border: none;
  padding: 0;
  line-height: 1;
  z-index: 10;
}

.arhisoft-close:hover {
  background: #e2e8f0;
  color: #64748b;
  transform: rotate(90deg);
}

@media (max-width: 640px) {
  .arhisoft-websitepopup { 
    padding: 24px 16px;
    max-width: calc(100% - 32px);
    border-radius: 0;
    max-height: 90vh;
  }
  
  .popup-content {
    padding: 0 12px;
  }
  
  .arhisoft-websitepopup h2 {
    font-size: 24px;
    margin-bottom: 12px;
  }
  
  .popup-subtitle {
    font-size: 15px;
    margin-bottom: 28px;
  }
  
  .arhisoft-form {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .arhisoft-cta {
    width: 100%;
    border-radius: 4px;
  }
  
  .arhisoft-buttons {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .arhisoft-button {
    padding: 20px 16px;
    aspect-ratio: auto;
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    margin: 0 4px;
  }
  
  .button-icon {
    margin: 0 16px 0 0;
    font-size: 36px;
  }
  
  .arhisoft-close {
    right: 16px;
    top: 16px;
    width: 36px;
    height: 36px;
  }
}
