/* ═══════════════════════════════════════
   PASSWORD GATE
   ═══════════════════════════════════════ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #1A1A1A;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s, visibility 0.4s;
}

.gate.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate-card {
  text-align: center;
  width: 100%;
  max-width: 360px;
  padding: 0 24px;
}

.gate-logo-img {
  height: 48px;
  width: auto;
  margin: 0 auto 8px;
  display: block;
  /* Logo is white on transparent — works on dark gate bg */
}

.gate-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 40px;
  font-weight: 300;
}

#gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#gate-input {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

#gate-input:focus {
  border-color: rgba(255,255,255,0.3);
}

#gate-input::placeholder {
  color: rgba(255,255,255,0.3);
}

.gate-btn {
  width: 100%;
  padding: 14px;
  background: #2D4A3E;
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.gate-btn:hover { background: #1E3329; }

.gate-error {
  color: #E57373;
  font-size: 13px;
  margin-top: 12px;
  opacity: 0;
  transition: opacity 0.2s;
}

.gate-error.show { opacity: 1; }

/* ═══════════════════════════════════════
   CUSTOMIZER PANEL
   ═══════════════════════════════════════ */
.customizer {
  position: fixed;
  top: 0; right: 0;
  width: 340px;
  height: 100vh;
  z-index: 200;
  background: #1A1A1A;
  color: #E0E0E0;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 40px rgba(0,0,0,0.2);
  font-family: 'DM Sans', sans-serif;
}

.customizer.open { transform: translateX(0); }

.customizer-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
}

.customizer-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: white;
  margin-bottom: 4px;
}

.customizer-header p {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  font-weight: 300;
}

.customizer-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

.customizer-close:hover { color: white; }

/* ── Presets ── */
.presets-section {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.presets-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.presets-header .cz-group-title { margin-bottom: 0; }

.preset-save-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.preset-save-btn:hover {
  background: rgba(255,255,255,0.14);
  color: white;
}

.presets-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.presets-empty {
  font-size: 12px;
  color: rgba(255,255,255,0.25);
  font-style: italic;
  padding: 4px 0;
}

.preset-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  background: rgba(255,255,255,0.04);
  border: 1px solid transparent;
}

.preset-item:hover {
  background: rgba(255,255,255,0.08);
}

.preset-item.active {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
}

.preset-swatches {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.preset-swatch {
  width: 14px; height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.1);
}

.preset-name {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preset-item.active .preset-name { color: white; }

.preset-delete {
  background: none;
  border: none;
  color: rgba(255,255,255,0.2);
  font-size: 16px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.2s;
}

.preset-delete:hover { color: #E57373; }

/* ── Save dialog ── */
.preset-save-dialog {
  display: none;
  gap: 6px;
  margin-top: 10px;
}

.preset-save-dialog.show { display: flex; }

.preset-save-input {
  flex: 1;
  padding: 7px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  outline: none;
}

.preset-save-input::placeholder { color: rgba(255,255,255,0.25); }
.preset-save-input:focus { border-color: rgba(255,255,255,0.3); }

.preset-save-confirm {
  padding: 7px 14px;
  background: #2D4A3E;
  color: white;
  border: none;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.preset-save-confirm:hover { background: #3A6152; }

.customizer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.customizer-body::-webkit-scrollbar { width: 6px; }
.customizer-body::-webkit-scrollbar-track { background: transparent; }
.customizer-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* ── Group ── */
.cz-group {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.cz-group-title {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  font-weight: 600;
  margin-bottom: 14px;
}

/* ── Color row ── */
.cz-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cz-row:last-child { margin-bottom: 0; }

.cz-label {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,0.7);
}

.cz-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cz-color-wrap {
  position: relative;
  width: 32px; height: 32px;
}

.cz-color-input {
  width: 32px; height: 32px;
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  background: none;
  -webkit-appearance: none;
  appearance: none;
}

.cz-color-input::-webkit-color-swatch-wrapper { padding: 0; }
.cz-color-input::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

.cz-color-input::-moz-color-swatch {
  border: none;
  border-radius: 4px;
}

.cz-hex {
  width: 76px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px;
  color: rgba(255,255,255,0.6);
  font-family: 'DM Sans', monospace;
  font-size: 12px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

.cz-hex:focus {
  border-color: rgba(255,255,255,0.3);
  color: white;
}

/* ── Footer ── */
.customizer-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.customizer-btn {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.1s;
}

.customizer-btn:active { transform: scale(0.98); }

.customizer-btn-primary {
  background: #2D4A3E;
  color: white;
}

.customizer-btn-primary:hover { background: #3A6152; }

.customizer-btn-secondary {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.6);
}

.customizer-btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

/* ── Toggle button ── */
.customizer-toggle {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 199;
  background: #1A1A1A;
  color: white;
  border: none;
  border-radius: 50px;
  padding: 14px 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}

.customizer-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.customizer-toggle svg {
  animation: spin-slow 8s linear infinite;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── Toast notification ── */
.toast {
  position: fixed;
  bottom: 80px; right: 24px;
  z-index: 300;
  background: #1A1A1A;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════
   RESPONSIVE CUSTOMIZER
   ═══════════════════════════════════════ */
@media (max-width: 480px) {
  .customizer { width: 100%; }
  .customizer-toggle span { display: none; }
  .customizer-toggle { padding: 14px; border-radius: 50%; }
}
