/* ============================================
   OUTBACK BYTE — UI Components
   Modal · Cookie Banner · Checkbox · Select
   Light Theme v1.4
   ============================================ */

/* ─── SUCCESS MODAL ─────────────────────────── */
.tnd-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(31, 45, 58, 0);
  backdrop-filter: blur(0);
  pointer-events: none;
  transition: background 0.32s ease, backdrop-filter 0.32s ease;
}

.tnd-modal-overlay.open {
  background: rgba(31, 45, 58, 0.45);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.tnd-modal {
  background: linear-gradient(145deg, #ffffff, #fbfaf6);
  border: 1px solid rgba(46, 71, 93, 0.10);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow:
    0 32px 80px rgba(46, 71, 93, 0.18),
    0 0 0 1px rgba(46, 71, 93, 0.04);
  transform: scale(0.88) translateY(20px);
  opacity: 0;
  transition:
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease;
  position: relative;
}

.tnd-modal-overlay.open .tnd-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.tnd-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(46, 71, 93, 0.06);
  border: 1px solid rgba(46, 71, 93, 0.10);
  color: #5d6e80;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  transition: all 0.2s;
  font-family: inherit;
  line-height: 1;
}
.tnd-modal__close:hover {
  background: rgba(198, 69, 69, 0.10);
  border-color: rgba(198, 69, 69, 0.28);
  color: #c64545;
}
.tnd-modal__close:focus-visible {
  outline: 2px solid var(--brand-1);
  outline-offset: 2px;
}

.tnd-modal__icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  display: block;
  animation: tnd-modal-icon-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}
@keyframes tnd-modal-icon-bounce {
  from { transform: scale(0.3) rotate(-15deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);     opacity: 1; }
}

.tnd-modal__title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1f2d3a;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.tnd-modal__text {
  font-size: 0.9375rem;
  color: #5d6e80;
  line-height: 1.7;
  margin-bottom: 1.75rem;
}

.tnd-modal__text strong {
  color: #1d3e63;
}

.tnd-modal__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: linear-gradient(135deg, #d97f2c, #e85d4d);
  border: none;
  border-radius: 9999px;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 8px 22px rgba(217, 127, 44, 0.28);
  text-decoration: none;
}
.tnd-modal__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(217, 127, 44, 0.36);
}
.tnd-modal__cta:focus-visible {
  outline: 2px solid #2d5a87;
  outline-offset: 3px;
}

/* Top accent stripe */
.tnd-modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #2d5a87, #d97f2c, #f4b94a);
  border-radius: 24px 24px 0 0;
}

/* ─── COOKIE BANNER ────────────────────────── */
.tnd-cookie {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid rgba(46, 71, 93, 0.12);
  backdrop-filter: blur(18px);
  padding: 1.125rem 1.5rem;
  box-shadow: 0 -8px 32px rgba(46, 71, 93, 0.10);
  transform: translateY(0);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.tnd-cookie.hidden {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}

.tnd-cookie__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.tnd-cookie__icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.tnd-cookie__text {
  flex: 1;
  font-size: 0.8125rem;
  color: #354758;
  line-height: 1.6;
  min-width: 200px;
}

.tnd-cookie__text a {
  color: #2d5a87;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
  font-weight: 600;
}
.tnd-cookie__text a:hover { color: #1d3e63; }

.tnd-cookie__actions {
  display: flex;
  gap: 0.625rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.tnd-cookie__btn {
  padding: 0.625rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
  border: none;
}

.tnd-cookie__btn--accept {
  background: linear-gradient(135deg, #d97f2c, #e85d4d);
  color: #fff;
  box-shadow: 0 6px 16px rgba(217, 127, 44, 0.28);
}
.tnd-cookie__btn--accept:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(217, 127, 44, 0.36);
}
.tnd-cookie__btn--accept:focus-visible {
  outline: 2px solid #2d5a87;
  outline-offset: 2px;
}

.tnd-cookie__btn--secondary {
  background: rgba(46, 71, 93, 0.06);
  color: #354758;
  border: 1px solid rgba(46, 71, 93, 0.18);
}
.tnd-cookie__btn--secondary:hover {
  background: rgba(45, 90, 135, 0.08);
  border-color: rgba(45, 90, 135, 0.32);
  color: #1d3e63;
}
.tnd-cookie__btn--secondary:focus-visible {
  outline: 2px solid #2d5a87;
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .tnd-cookie__inner { gap: 0.875rem; }
  .tnd-cookie__actions { width: 100%; }
  .tnd-cookie__btn { flex: 1; text-align: center; }
}

/* ─── CUSTOM CHECKBOX ───────────────────────── */
.tnd-check {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.tnd-check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.tnd-check__box {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1.5px solid rgba(46, 71, 93, 0.28);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    background 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.22s;
  position: relative;
  overflow: hidden;
}

.tnd-check__box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #d97f2c, #e85d4d);
  border-radius: 3px;
  transform: scale(0);
  opacity: 0;
  transition:
    transform 0.22s cubic-bezier(0.34, 1.3, 0.64, 1),
    opacity 0.18s ease;
}

.tnd-check__tick {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transform: scale(0) rotate(-20deg);
  opacity: 0;
  transition:
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.2s ease;
}

.tnd-check:hover .tnd-check__box {
  border-color: rgba(217, 127, 44, 0.55);
  box-shadow: 0 0 0 3px rgba(217, 127, 44, 0.10);
}

.tnd-check input:checked ~ .tnd-check__box {
  border-color: transparent;
  box-shadow: 0 4px 10px rgba(217, 127, 44, 0.30);
}
.tnd-check input:checked ~ .tnd-check__box::before {
  transform: scale(1);
  opacity: 1;
}
.tnd-check input:checked ~ .tnd-check__box .tnd-check__tick {
  transform: scale(1) rotate(0deg);
  opacity: 1;
}

.tnd-check input:focus-visible ~ .tnd-check__box {
  outline: 2px solid #2d5a87;
  outline-offset: 2px;
}

.tnd-check__label {
  font-size: 0.8125rem;
  color: #354758;
  line-height: 1.5;
}
.tnd-check__label a {
  color: #2d5a87;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

/* ─── CUSTOM SELECT ─────────────────────────── */
.tnd-select-wrap {
  position: relative;
  width: 100%;
  z-index: 10;
}

.tnd-select-wrap select {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
}

.tnd-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  background: #ffffff;
  border: 1.5px solid rgba(46, 71, 93, 0.18);
  border-radius: 10px;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s,
    box-shadow 0.2s;
  user-select: none;
  min-height: 46px;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(46, 71, 93, 0.05);
  position: relative;
  z-index: 1;
}

.tnd-select-trigger:hover {
  border-color: rgba(45, 90, 135, 0.45);
  background: #fbfaf6;
}

.tnd-select-wrap.open .tnd-select-trigger {
  border-color: var(--brand-1);
  background: #fbfaf6;
  box-shadow: 0 0 0 3px rgba(45, 90, 135, 0.14);
}

.tnd-select-wrap:focus-within .tnd-select-trigger {
  outline: 2px solid #2d5a87;
  outline-offset: 2px;
}

.tnd-select-value {
  font-size: 0.875rem;
  color: #5d6e80;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tnd-select-wrap.has-value .tnd-select-value {
  color: #1f2d3a;
  font-weight: 600;
}

.tnd-select-arrow {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #8497a8;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s;
}

.tnd-select-wrap.open .tnd-select-arrow {
  transform: rotate(180deg);
  color: #2d5a87;
}

.tnd-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid rgba(46, 71, 93, 0.14);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(46, 71, 93, 0.18);
  z-index: 9999;
  overflow: hidden;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(45, 90, 135, 0.30) transparent;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.18s ease;
  transform-origin: top center;
}

.tnd-select-dropdown::-webkit-scrollbar { width: 4px; }
.tnd-select-dropdown::-webkit-scrollbar-thumb {
  background: rgba(45, 90, 135, 0.30);
  border-radius: 4px;
}

.tnd-select-wrap.open .tnd-select-dropdown {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.tnd-select-wrap.flip-up .tnd-select-dropdown {
  top: auto;
  bottom: calc(100% + 6px);
  transform-origin: bottom center;
}

.tnd-select-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  font-size: 0.875rem;
  color: #354758;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-bottom: 1px solid rgba(46, 71, 93, 0.05);
  opacity: 0;
  transform: translateX(-4px);
  animation: tnd-opt-in 0.2s ease forwards;
}

@keyframes tnd-opt-in {
  to { opacity: 1; transform: translateX(0); }
}

.tnd-select-option:last-child { border-bottom: none; }

.tnd-select-option:hover,
.tnd-select-option.focused {
  background: #fbfaf6;
  color: #1d3e63;
}

.tnd-select-option.selected {
  background: rgba(45, 90, 135, 0.08);
  color: #1d3e63;
  font-weight: 700;
}

.tnd-select-option.selected::after {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d97f2c;
  margin-left: auto;
  flex-shrink: 0;
}

.tnd-select-option--placeholder {
  color: #8497a8;
  font-style: italic;
}

/* ─── REDUCED MOTION ──────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .tnd-modal,
  .tnd-modal-overlay,
  .tnd-cookie,
  .tnd-check__box,
  .tnd-check__box::before,
  .tnd-check__tick,
  .tnd-select-trigger,
  .tnd-select-dropdown,
  .tnd-select-arrow,
  .tnd-modal__icon {
    transition: none !important;
    animation: none !important;
  }
  .tnd-modal-overlay.open .tnd-modal {
    transform: none;
    opacity: 1;
  }
}
