/* Phone input with country code select – registration page enhancements */
.login-form select.form-control {
    appearance: none;
    padding-right: 2.5em;
    background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%),
                      linear-gradient(135deg, #94a3b8 50%, transparent 50%),
                      linear-gradient(to right, transparent, transparent);
    background-position: calc(100% - 18px) calc(50% - 6px),
                         calc(100% - 12px) calc(50% - 6px),
                         calc(100% - 2.5em) 50%;
    background-size: 6px 6px, 6px 6px, 1px 1.5em;
    background-repeat: no-repeat;
}
.login-form .phone-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.login-form .country-select {
    flex: 0 0 220px;
    max-width: 220px;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%),
                      linear-gradient(135deg, #94a3b8 50%, transparent 50%),
                      linear-gradient(to right, transparent, transparent);
    background-position: calc(100% - 18px) calc(50% - 6px),
                         calc(100% - 12px) calc(50% - 6px),
                         calc(100% - 2.5em) 50%;
    background-size: 6px 6px, 6px 6px, 1px 1.5em;
    background-repeat: no-repeat;
}

/* Optgroup label styling for selects */
.login-form select.form-control optgroup {
    color: #334155;
    font-weight: 600;
}

/* Dark theme: native select optgroup labels */
.theme-dark .login-form select.form-control optgroup {
    color: var(--muted);
}



/* Nice Select component styles */
.nice-select {
  position: relative;
  width: 100%;
}
.nice-select .ns-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 6px;
  background: #fff;
  color: #212529;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.nice-select:focus .ns-control,
.nice-select.open .ns-control {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.2rem rgba(13,110,253,.15);
}
.nice-select .ns-arrow {
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #666;
  margin-left: 0.5rem;
}
.nice-select.open .ns-arrow {
  border-top-color: transparent;
  border-bottom: 6px solid #666;
}
.nice-select .ns-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  display: none;
}
.nice-select .ns-search {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  border-bottom: 1px solid #eee;
  outline: none;
  font-size: 0.95rem;
}
.nice-select .ns-options {
  max-height: 260px;
  overflow: auto;
}
.nice-select .ns-group {
  padding: 0.25rem 0;
}
.nice-select .ns-group-label {
  padding: 0.35rem 0.75rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: #495057;
  background: #f8f9fa;
  border-top: 1px solid #f1f3f5;
  border-bottom: 1px solid #f1f3f5;
}
.nice-select .ns-option {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.nice-select .ns-option:hover,
.nice-select .ns-option.focused {
  background: #f1f5ff;
}
.nice-select .ns-option.selected {
  background: #e7f1ff;
  color: #0d6efd;
}
.ns-hidden-select {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Dark theme overrides for Nice Select */
.theme-dark .nice-select .ns-control {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.theme-dark .nice-select.open .ns-control {
  border-color: var(--border);
  box-shadow: 0 0 0 0.2rem rgba(59,130,246,.20);
}
.theme-dark .nice-select .ns-arrow {
  border-top-color: #cbd5e1;
}
.theme-dark .nice-select.open .ns-arrow {
  border-bottom-color: #cbd5e1;
}
.theme-dark .nice-select .ns-dropdown {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 12px 32px rgba(2,6,23,0.45);
}
.theme-dark .nice-select .ns-search {
  background: var(--surface);
  color: var(--text);
  border-bottom-color: var(--border);
}
.theme-dark .nice-select .ns-search::placeholder {
  color: var(--muted);
}
.theme-dark .nice-select .ns-group-label {
  color: var(--muted);
  background: rgba(17,24,39,0.55);
  border-top-color: var(--border);
  border-bottom-color: var(--border);
}
.theme-dark .nice-select .ns-option {
  color: var(--text);
}
.theme-dark .nice-select .ns-option:hover,
.theme-dark .nice-select .ns-option.focused {
  background: rgba(2,6,23,0.65);
}
.theme-dark .nice-select .ns-option.selected {
  background: rgba(59,130,246,0.18);
  color: var(--primary);
}