/*!
 * DijitalMask v1.0.0
 * Modern, Independent, Turkey-Optimized Input Masking & Validation Library
 * (c) 2026 DijitalUI Team
 * Released under the MIT License.
 */
/* src/dijital-mask.css */
:root {
  --dm-font:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  --dm-bg-surface: #ffffff;
  --dm-bg-muted: #f4f4f5;
  --dm-border: #e4e4e7;
  --dm-border-focus: #18181b;
  --dm-text: #18181b;
  --dm-text-muted: #71717a;
  --dm-text-subtle: #a1a1aa;
  --dm-primary: #18181b;
  --dm-primary-subtle: rgba(24, 24, 27, 0.06);
  --dm-valid: #10b981;
  --dm-valid-border: #10b981;
  --dm-valid-subtle: rgba(16, 185, 129, 0.12);
  --dm-invalid: #ef4444;
  --dm-invalid-border: #ef4444;
  --dm-invalid-subtle: rgba(239, 68, 68, 0.10);
  --dm-radius: 6px;
  --dm-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
html[data-theme=dark] {
  --dm-bg-surface: #18181b;
  --dm-bg-muted: #27272a;
  --dm-border: #27272a;
  --dm-border-focus: #fafafa;
  --dm-text: #fafafa;
  --dm-text-muted: #a1a1aa;
  --dm-text-subtle: #71717a;
  --dm-primary: #fafafa;
  --dm-primary-subtle: rgba(250, 250, 250, 0.08);
  --dm-valid: #34d399;
  --dm-valid-border: #059669;
  --dm-valid-subtle: rgba(52, 211, 153, 0.14);
  --dm-invalid: #f87171;
  --dm-invalid-border: #dc2626;
  --dm-invalid-subtle: rgba(248, 113, 113, 0.14);
}
.dm-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}
.dm-input {
  width: 100%;
  height: 38px;
  padding: 8px 12px;
  font-family: var(--dm-font);
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--dm-text);
  background-color: var(--dm-bg-surface);
  border: 1px solid var(--dm-border);
  border-radius: var(--dm-radius);
  box-shadow: var(--dm-shadow-sm);
  outline: none;
  box-sizing: border-box;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease;
}
.dm-input:hover:not(:disabled) {
  border-color: #cbd5e1;
}
html[data-theme=dark] .dm-input:hover:not(:disabled) {
  border-color: #3f3f46;
}
.dm-input:focus {
  border-color: var(--dm-border-focus);
  box-shadow: 0 0 0 3px var(--dm-primary-subtle);
}
.dm-input:disabled {
  background-color: var(--dm-bg-muted);
  cursor: not-allowed;
  opacity: 0.65;
}
.dm-has-badge .dm-input,
.dm-wrapper.dm-has-badge input {
  padding-right: 48px;
}
.dm-has-status .dm-input,
.dm-wrapper.dm-has-status input {
  padding-right: 36px;
}
.dm-has-badge.dm-has-status .dm-input,
.dm-wrapper.dm-has-badge.dm-has-status input {
  padding-right: 74px;
}
.dm-input.dm-valid,
.dm-wrapper.dm-is-valid .dm-input,
input.dm-valid {
  border-color: var(--dm-valid-border) !important;
}
.dm-input.dm-valid:focus,
.dm-wrapper.dm-is-valid .dm-input:focus,
input.dm-valid:focus {
  box-shadow: 0 0 0 3px var(--dm-valid-subtle) !important;
}
.dm-input.dm-invalid,
.dm-wrapper.dm-is-invalid .dm-input,
input.dm-invalid {
  border-color: var(--dm-invalid-border) !important;
  animation: dmShake 0.3s ease-in-out;
}
.dm-input.dm-invalid:focus,
.dm-wrapper.dm-is-invalid .dm-input:focus,
input.dm-invalid:focus {
  box-shadow: 0 0 0 3px var(--dm-invalid-subtle) !important;
}
@keyframes dmShake {
  0%, 100% {
    transform: translateX(0);
  }
  20%, 60% {
    transform: translateX(-3px);
  }
  40%, 80% {
    transform: translateX(3px);
  }
}
.dm-badge-container {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 2;
}
.dm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 5px;
  min-width: 24px;
  height: 22px;
  box-sizing: border-box;
  border-radius: 5px;
  background-color: var(--dm-badge-brand-bg, var(--dm-bg-muted));
  border: 1px solid var(--dm-badge-brand-color, var(--dm-border));
  color: var(--dm-badge-brand-color, var(--dm-text));
  animation: dmFadeScale 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: default;
}
.dm-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.dm-badge-icon svg {
  width: 100%;
  height: 100%;
  max-width: 16px;
  max-height: 16px;
  display: block;
}
.dm-badge-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
}
.dm-badge-bank {
  background-color: var(--dm-badge-brand-bg, var(--dm-bg-muted));
  border-color: var(--dm-badge-brand-color, var(--dm-border));
  color: var(--dm-badge-brand-color, var(--dm-text));
}
.dm-badge-card {
  background-color: var(--dm-badge-brand-bg, var(--dm-bg-muted));
  border-color: var(--dm-badge-brand-color, var(--dm-border));
  color: var(--dm-badge-brand-color, var(--dm-text));
}
.dm-status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  animation: dmFadeScale 0.15s ease-out forwards;
}
.dm-status-valid {
  color: var(--dm-valid);
}
.dm-status-invalid {
  color: var(--dm-invalid);
}
@keyframes dmFadeScale {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.dm-feedback {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  margin-top: 5px;
  min-height: 16px;
  transition: all 0.18s ease;
}
.dm-feedback:empty {
  display: none;
}
.dm-feedback.dm-feedback-valid {
  color: var(--dm-valid);
}
.dm-feedback.dm-feedback-valid::before {
  content: "\2713";
  font-weight: 700;
}
.dm-feedback.dm-feedback-invalid {
  color: var(--dm-invalid);
  animation: dmShake 0.25s ease-in-out;
}
.dm-feedback.dm-feedback-invalid::before {
  content: "\2715";
  font-weight: 700;
}
.dm-feedback.dm-feedback-hint {
  color: var(--dm-text-muted);
}
.dm-feedback.dm-feedback-hint::before {
  content: "\2022";
  font-size: 13px;
}
.dm-wrapper.dm-has-country-select .dm-input,
.dm-has-country-select input.dm-input,
.dm-has-country-select .dm-input {
  padding-left: 96px !important;
}
.dm-country-select {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
}
.dm-country-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 6px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--dm-text);
  font-family: var(--dm-font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: background-color 0.15s ease;
  user-select: none;
}
.dm-country-btn:hover {
  background-color: var(--dm-bg-muted);
}
.dm-country-flag {
  font-size: 15px;
  line-height: 1;
}
.dm-country-dial {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dm-text);
}
.dm-country-arrow {
  width: 10px;
  height: 10px;
  color: var(--dm-text-muted);
  transition: transform 0.18s ease;
}
.dm-country-select.is-open .dm-country-arrow {
  transform: rotate(180deg);
}
.dm-country-divider {
  width: 1px;
  height: 18px;
  background-color: var(--dm-border);
  margin-left: 2px;
}
.dm-country-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 280px;
  max-height: 320px;
  background-color: var(--dm-bg-surface);
  border: 1px solid var(--dm-border);
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.18), 0 8px 10px -6px rgba(0, 0, 0, 0.12);
  display: none;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  animation: dmFadeScale 0.15s ease-out forwards;
}
.dm-country-select.is-open .dm-country-dropdown {
  display: flex;
}
.dm-country-search-box {
  padding: 8px;
  border-bottom: 1px solid var(--dm-border);
  background-color: var(--dm-bg-surface);
}
.dm-country-search {
  width: 100%;
  height: 30px;
  padding: 4px 8px;
  font-family: var(--dm-font);
  font-size: 12.5px;
  color: var(--dm-text);
  background-color: var(--dm-bg-muted);
  border: 1px solid var(--dm-border);
  border-radius: 5px;
  outline: none;
  box-sizing: border-box;
}
.dm-country-search:focus {
  border-color: var(--dm-border-focus);
}
.dm-country-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  max-height: 230px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dm-country-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--dm-text);
  transition: background-color 0.12s ease;
}
.dm-country-item:hover,
.dm-country-item.is-selected {
  background-color: var(--dm-bg-muted);
}
.dm-country-item.is-selected {
  font-weight: 600;
}
.dm-country-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dm-country-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dm-country-item-dial {
  font-size: 12px;
  font-weight: 600;
  color: var(--dm-text-muted);
  flex-shrink: 0;
  margin-left: 8px;
}
