/* Preloader style picker (settings) + runtime overlay */

.kurumsal-preloader-style-grid.form-selectgroup,
.kurumsal-preloader-style-grid.form-selectgroup-boxes {
  display: block;
  gap: 0;
}

.kurumsal-preloader-style-grid .kurumsal-preloader-style-item {
  display: block;
  height: 100%;
  margin: 0;
}

.kurumsal-preloader-style-grid .form-selectgroup-input {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  opacity: 0;
}

.kurumsal-preloader-style-card {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  height: 100%;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0.45rem !important;
  text-align: center !important;
  color: var(--tblr-secondary, #64748b) !important;
  background: var(--tblr-bg-surface, #fff) !important;
  border: 1px solid var(--tblr-border-color, #e5e7eb) !important;
  border-radius: var(--tblr-border-radius, 0.5rem) !important;
  box-shadow: none !important;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kurumsal-preloader-style-card:hover {
  border-color: color-mix(in srgb, var(--tblr-secondary, #6b7280) 35%, var(--tblr-border-color, #e5e7eb)) !important;
  color: var(--tblr-body-color, #334155) !important;
}

.kurumsal-preloader-style-grid .form-selectgroup-input:checked + .kurumsal-preloader-style-card {
  z-index: 1;
  color: var(--tblr-secondary, #64748b) !important;
  background: var(--tblr-bg-surface, #fff) !important;
  border-color: var(--tblr-primary, #066fd1) !important;
  box-shadow: 0 0 0 1px var(--tblr-primary, #066fd1);
}

.kurumsal-preloader-style-grid .form-selectgroup-input:focus-visible + .kurumsal-preloader-style-card {
  outline: 2px solid color-mix(in srgb, var(--tblr-primary, #066fd1) 45%, transparent);
  outline-offset: 2px;
}

.kurumsal-preloader-style-preview-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.75rem;
  padding: 0.9rem 0.5rem;
  border-radius: calc(var(--tblr-border-radius, 0.5rem) - 2px);
  background: var(--tblr-bg-surface-secondary, #eef2f6);
  color: var(--tblr-secondary, #64748b);
}

.kurumsal-preloader-style-name {
  display: block;
  padding: 0 0.15rem 0.15rem;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--tblr-body-color, #334155);
  white-space: nowrap;
}

/* Shared anim host */
.kurumsal-preloader-anim {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  color: inherit;
}

/* Daire — thin spinning arc with fade */
.kurumsal-preloader-anim--circle::before {
  content: "";
  box-sizing: border-box;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-right-color: color-mix(in srgb, currentColor 45%, transparent);
  opacity: 0.95;
  animation: kurumsal-spin 0.7s linear infinite;
}

/* Noktalar — 3 sequential dots */
.kurumsal-preloader-anim--dots {
  gap: 0.38rem;
  width: auto;
  height: auto;
}

.kurumsal-preloader-anim--dots span {
  display: block;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: currentColor;
  animation: kurumsal-dot-fade 1.05s ease-in-out infinite;
}

.kurumsal-preloader-anim--dots span:nth-child(1) { animation-delay: 0s; }
.kurumsal-preloader-anim--dots span:nth-child(2) { animation-delay: 0.18s; }
.kurumsal-preloader-anim--dots span:nth-child(3) { animation-delay: 0.36s; }

/* Nabız — solid pulse */
.kurumsal-preloader-anim--pulse::before {
  content: "";
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: currentColor;
  animation: kurumsal-pulse 1.15s ease-in-out infinite;
}

/* Halka — thicker ring segment */
.kurumsal-preloader-anim--ring::before {
  content: "";
  box-sizing: border-box;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, currentColor 18%, transparent);
  border-top-color: currentColor;
  animation: kurumsal-spin 0.8s linear infinite;
}

/* Çubuklar — 5 equalizer bars */
.kurumsal-preloader-anim--bars {
  align-items: flex-end;
  gap: 0.2rem;
  width: auto;
  height: 1.45rem;
}

.kurumsal-preloader-anim--bars span {
  display: block;
  width: 0.2rem;
  border-radius: 1px;
  background: currentColor;
  transform-origin: bottom center;
  animation: kurumsal-bar 0.85s ease-in-out infinite;
}

.kurumsal-preloader-anim--bars span:nth-child(1) {
  height: 0.4rem;
  animation-delay: 0s;
}

.kurumsal-preloader-anim--bars span:nth-child(2) {
  height: 0.7rem;
  animation-delay: 0.1s;
}

.kurumsal-preloader-anim--bars span:nth-child(3) {
  height: 1.15rem;
  animation-delay: 0.2s;
}

.kurumsal-preloader-anim--bars span:nth-child(4) {
  height: 0.85rem;
  animation-delay: 0.3s;
}

.kurumsal-preloader-anim--bars span:nth-child(5) {
  height: 0.5rem;
  animation-delay: 0.4s;
}

/* Yörünge — 3 dots in a triangle, spinning */
.kurumsal-preloader-anim--orbit {
  width: 1.7rem;
  height: 1.7rem;
  animation: kurumsal-spin 1.2s linear infinite;
}

.kurumsal-preloader-anim--orbit span {
  position: absolute;
  width: 0.36rem;
  height: 0.36rem;
  border-radius: 50%;
  background: currentColor;
}

.kurumsal-preloader-anim--orbit span:nth-child(1) {
  top: 0;
  left: 50%;
  margin-left: -0.18rem;
  opacity: 1;
}

.kurumsal-preloader-anim--orbit span:nth-child(2) {
  right: 0.05rem;
  bottom: 0.15rem;
  opacity: 0.75;
}

.kurumsal-preloader-anim--orbit span:nth-child(3) {
  left: 0.05rem;
  bottom: 0.15rem;
  opacity: 0.55;
}

/* Runtime overlay */
.kurumsal-page-preloader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface, var(--tblr-bg-surface, #fff));
  color: var(--color-brand, var(--tblr-primary, #066fd1));
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.kurumsal-preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.kurumsal-preloader-logo {
  display: block;
  width: auto;
  max-width: min(220px, 56vw);
  max-height: 56px;
  height: auto;
  object-fit: contain;
}

.kurumsal-page-preloader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.kurumsal-page-preloader .kurumsal-preloader-anim {
  width: 3rem;
  height: 3rem;
  transform: scale(1.3);
}

.kurumsal-page-preloader .kurumsal-preloader-anim--bars {
  height: 1.75rem;
  width: auto;
  transform: scale(1.45);
}

.kurumsal-page-preloader .kurumsal-preloader-anim--dots {
  width: auto;
  height: auto;
  transform: scale(1.4);
}

@keyframes kurumsal-spin {
  to { transform: rotate(360deg); }
}

@keyframes kurumsal-pulse {
  0%, 100% { transform: scale(0.65); opacity: 0.4; }
  50% { transform: scale(1.2); opacity: 1; }
}

@keyframes kurumsal-dot-fade {
  0%, 80%, 100% { opacity: 0.28; transform: scale(0.9); }
  40% { opacity: 1; transform: scale(1); }
}

@keyframes kurumsal-bar {
  0%, 100% { transform: scaleY(0.4); opacity: 0.5; }
  50% { transform: scaleY(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .kurumsal-preloader-anim--circle::before,
  .kurumsal-preloader-anim--ring::before,
  .kurumsal-preloader-anim--orbit,
  .kurumsal-preloader-anim--pulse::before,
  .kurumsal-preloader-anim--dots span,
  .kurumsal-preloader-anim--bars span {
    animation-duration: 1.6s;
  }
}
