@import url("theme.css");

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-body);
  color: #e8eaf6;
  background: radial-gradient(circle at top right, rgba(154, 72, 255, 0.16), transparent 24%),
    radial-gradient(circle at bottom left, rgba(35, 198, 255, 0.12), transparent 24%),
    linear-gradient(180deg, var(--bg-deep-top) 0%, var(--bg-deep-mid) 46%, var(--bg-deep-bottom) 100%),
    url(../img/bg3.jpg) no-repeat center center fixed;
  background-size: cover;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.07), transparent 35%);
  pointer-events: none;
}

.setting-header {
  position: relative;
  padding-top: 0.5rem;
}

.setting-hero {
  text-align: center;
  padding: 2rem 1rem 0.75rem;
}

.setting-kicker {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(0.72rem, 1.6vw, 0.88rem);
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(157, 232, 255, 0.88);
}

.setting-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #f8f6ff;
  text-shadow: 0 0 28px rgba(154, 72, 255, 0.24);
}

.setting-hero h1::after {
  content: "";
  display: block;
  width: min(220px, 55%);
  height: 2px;
  margin: 0.85rem auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(154, 72, 255, 0.9), rgba(35, 198, 255, 0.85), transparent);
}

.setting-subtitle {
  margin: 0.85rem auto 0;
  max-width: 520px;
  font-size: clamp(0.92rem, 2vw, 1.02rem);
  letter-spacing: 0.04em;
  color: rgba(200, 208, 240, 0.82);
}

.setting-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 0 1rem 1.25rem;
}

.setting-btn {
  position: relative;
  min-width: 160px;
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: 16px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f8f4ff;
  cursor: pointer;
  transform: translateY(0);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.setting-btn::before {
  content: "";
  position: absolute;
  inset: 4px 8px auto;
  height: 38%;
  border-radius: 12px 12px 14px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.03));
  pointer-events: none;
}

.setting-btn-reset {
  background: linear-gradient(180deg, rgba(230, 130, 130, 0.72) 0%, rgba(180, 70, 80, 0.62) 42%, rgba(130, 45, 58, 0.74) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.3) inset,
    0 -3px 0 rgba(0, 0, 0, 0.2) inset,
    0 8px 0 rgba(72, 22, 32, 0.55),
    0 11px 22px rgba(0, 0, 0, 0.32),
    0 0 24px rgba(255, 100, 100, 0.18);
}

.setting-btn-save {
  background: linear-gradient(180deg, rgba(120, 210, 170, 0.72) 0%, rgba(70, 165, 130, 0.58) 42%, rgba(45, 115, 90, 0.72) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.32) inset,
    0 -3px 0 rgba(0, 0, 0, 0.18) inset,
    0 8px 0 rgba(22, 58, 48, 0.52),
    0 11px 22px rgba(0, 0, 0, 0.32),
    0 0 24px rgba(80, 220, 160, 0.2);
}

.setting-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.setting-btn:active {
  filter: brightness(0.98);
  transform: translateY(4px);
}

.setting-panel {
  width: min(820px, calc(100% - 2rem));
  margin: 0 auto 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.setting-section {
  padding: 1.35rem 1.4rem 1.5rem;
  border-radius: 22px;
  background: rgba(12, 18, 38, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.setting-section-title {
  margin: 0 0 1.1rem;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f0eeff;
  position: relative;
  padding-bottom: 0.55rem;
}

.setting-section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(100%, 180px);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(154, 72, 255, 0.95), rgba(35, 198, 255, 0.75), transparent);
}

.setting-fields {
  display: grid;
  gap: 0.75rem;
}

.setting-fields-keys {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.setting-color-field,
.setting-key-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 16px;
  background: rgba(8, 12, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.setting-color-field:hover,
.setting-key-field:hover {
  border-color: rgba(144, 85, 255, 0.32);
  background: rgba(12, 18, 40, 0.88);
}

.setting-field-label {
  font-size: 0.92rem;
  font-weight: 500;
  color: #d9deff;
  letter-spacing: 0.02em;
}

.setting-color-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.setting-hex {
  min-width: 4.8rem;
  padding: 0.28rem 0.55rem;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-align: center;
  color: #9de8ff;
  background: rgba(35, 198, 255, 0.1);
  border: 1px solid rgba(35, 198, 255, 0.22);
}

.setting-color-input {
  width: 2.6rem;
  height: 2.6rem;
  padding: 0.15rem;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(14, 21, 49, 0.78);
  cursor: pointer;
}

.setting-color-input::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.setting-color-input::-webkit-color-swatch {
  border: none;
  border-radius: 8px;
}

.setting-key-field input[type="text"],
.setting-key-field input[type="number"] {
  flex: 1 1 120px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(14, 21, 49, 0.88);
  color: #f5f7ff;
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-align: center;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.setting-key-inputs {
  display: flex;
  flex: 1 1 160px;
  gap: 0.5rem;
  min-width: 0;
}

.setting-key-inputs input {
  flex: 1;
}

.setting-key-field input[type="text"]:focus,
.setting-key-field input[type="number"]:focus {
  border-color: rgba(144, 85, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(144, 85, 255, 0.14);
}

.setting-key-field input[type="text"]:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: #c8cce0;
}

.setting-toggle-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  background: rgba(8, 12, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.setting-toggle-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 3.1rem;
  height: 1.65rem;
}

.setting-toggle-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.setting-toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.setting-toggle-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #eef2ff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease, background 0.2s ease;
}

.setting-toggle-input:checked + .setting-toggle-slider {
  background: rgba(144, 85, 255, 0.55);
  border-color: rgba(154, 72, 255, 0.65);
  box-shadow: 0 0 16px rgba(144, 85, 255, 0.28);
}

.setting-toggle-input:checked + .setting-toggle-slider::after {
  transform: translateX(1.45rem);
  background: #fff;
}

.setting-toggle-input:focus-visible + .setting-toggle-slider {
  outline: 2px solid rgba(144, 85, 255, 0.55);
  outline-offset: 2px;
}

.setting-hint {
  margin: 0;
  padding: 0 0.2rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: rgba(180, 188, 220, 0.82);
}

footer {
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  margin: 0 auto;
}

footer p {
  margin: 0.75rem 0 0;
}

footer a:not(.nav-home-link):not(.nav-site-link) {
  color: #cab7ff;
  text-decoration: none;
}

footer a:not(.nav-home-link):not(.nav-site-link):hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .setting-hero {
    padding-top: 2.5rem;
  }

  .setting-color-field,
  .setting-key-field {
    flex-direction: column;
    align-items: stretch;
  }

  .setting-color-meta {
    justify-content: space-between;
  }

  .setting-fields-keys {
    grid-template-columns: 1fr;
  }
}
