:root {
  --kalert-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.kalert-lock {
  overflow: hidden !important;
}

.kalert-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: kalertFadeIn 0.22s ease both;
}

.kalert-overlay.kalert-leave {
  animation: kalertFadeOut 0.18s ease both;
}

.kalert-box {
  --kalert-accent: #3b82f6;
  --kalert-confirm: var(--kalert-accent);
  --kalert-cancel: #e5e7eb;
  --kalert-confirm-text: #ffffff;
  --kalert-cancel-text: #111827;
  position: relative;
  background: #ffffff;
  color: #0f172a;
  border-radius: 28px;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-family: var(--kalert-font);
  overflow: hidden;
  animation: kalertScaleIn 0.28s cubic-bezier(0.2, 0.9, 0.25, 1.2) both;
}

.kalert-leave .kalert-box {
  animation: kalertScaleOut 0.18s ease both;
}

.kalert-dark {
  background: #0f172a;
  color: #ffffff;
  border-color: rgba(148, 163, 184, 0.18);
}

.kalert-style-classic {
  border-radius: 16px;
}

.kalert-style-minimal {
  border-radius: 18px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.26);
}

.kalert-style-rounded {
  border-radius: 34px;
}

.kalert-content {
  padding: 30px;
  text-align: center;
}

.kalert-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: inherit;
  cursor: pointer;
  z-index: 2;
}

.kalert-close:hover {
  background: rgba(148, 163, 184, 0.25);
}

.kalert-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--kalert-accent) 12%, transparent);
  border: 2px solid color-mix(in srgb, var(--kalert-accent) 34%, transparent);
}

.kalert-icon i {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--kalert-accent);
  font-size: 28px;
  box-shadow: 0 14px 32px color-mix(in srgb, var(--kalert-accent) 32%, transparent);
}

.kalert-spin {
  animation: kalertSpin 0.85s linear infinite;
}

.kalert-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.22;
  letter-spacing: -0.03em;
}

.kalert-message {
  margin-top: 10px;
  color: #64748b;
  font-size: 15px;
  line-height: 1.6;
}

.kalert-dark .kalert-message {
  color: #cbd5e1;
}

.kalert-input-wrap {
  width: 100%;
  margin: 18px 0 22px;
}

.kalert-input {
  width: 100%;
  /* height: 48px; */
  padding: 16px 14px;
  border-radius: 14px;
  border: 1px solid #d1d5db;
  outline: none;
  background: #f8fafc;
  color: #0f172a;
  font-size: 15px;
  font-weight: 500;
  box-sizing: border-box;
  display: block;
  margin: 0;
  text-align: left;
}

.kalert-dark .kalert-input {
  background: #111827;
  border-color: #334155;
  color: #ffffff;
}

.kalert-input:focus {
  border-color: #38bdf8;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.16);
}

.kalert-input::placeholder {
  color: #94a3b8;
}


.kalert-input-invalid {
  border-color: #ef4444 !important;
}

.kalert-input-error {
  min-height: 18px;
  margin-top: 6px;
  color: #ef4444;
  font-size: 12px;
  font-weight: 700;
}

.kalert-buttons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.kalert-btn {
  flex: 1;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  padding: 0 18px;
  font: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.kalert-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
}

.kalert-btn-confirm {
  background: var(--kalert-confirm);
  color: var(--kalert-confirm-text);
}

.kalert-btn-cancel {
  background: var(--kalert-cancel);
  color: var(--kalert-cancel-text);
}

.kalert-image-wrap {
  margin-top: 18px;
  background: #f8fafc;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.kalert-image-big {
  height: 190px;
}

.kalert-image-circle {
  width: 100px;
  height: 100px;
  border-radius: 999px;
  margin-left: auto;
  margin-right: auto;
}

.kalert-image {
  width: 100%;
  /* height: 100%; */
  object-fit: cover;
}

.kalert-image-error {
  color: #64748b;
  gap: 8px;
  font-weight: 700;
}

.kalert-custom-html {
  margin-top: 18px;
  text-align: left;
}

.kalert-webview-wrap {
  position: relative;
  width: 100%;
  margin-top: 18px;
  border-radius: 18px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.kalert-dark .kalert-webview-wrap {
  background: #111827;
  border-color: #334155;
}

.kalert-webview {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #ffffff;
}

.kalert-web-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 3;
  background: color-mix(in srgb, var(--kalert-accent) 12%, transparent);
}

.kalert-web-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--kalert-accent);
  transition: width 0.22s ease;
}

.kalert-web-loader {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.kalert-web-loader span {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 4px solid color-mix(in srgb, var(--kalert-accent) 16%, #ffffff);
  border-top-color: var(--kalert-accent);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
  animation: kalertSpin 0.9s linear infinite;
}

.kalert-hidden {
  opacity: 0;
  visibility: hidden;
  transition: 0.18s ease;
}

.kalert-web-error {
  height: 100%;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px;
  color: #64748b;
}

.kalert-web-error i {
  color: var(--kalert-accent);
  font-size: 38px;
}

.kalert-web-error strong {
  color: #0f172a;
  font-size: 17px;
}

.kalert-dark .kalert-web-error strong {
  color: #ffffff;
}

@keyframes kalertFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes kalertFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes kalertScaleIn {
  from { transform: translateY(12px) scale(0.92); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes kalertScaleOut {
  from { transform: translateY(0) scale(1); opacity: 1; }
  to { transform: translateY(8px) scale(0.96); opacity: 0; }
}

@keyframes kalertSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 520px) {
  .kalert-overlay {
    align-items: flex-end;
    padding: 12px;
  }

  .kalert-box {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 26px;
  }

  .kalert-content {
    padding: 26px 20px;
  }

  .kalert-buttons {
    flex-direction: column-reverse;
  }
}
