/* K-Wired Website Order Form — forms.k-wired.com */
:root {
  --bg: #0a0a0c;
  --bg-elevated: #14161c;
  --bg-field: #1e2129;
  --border: rgba(255, 255, 255, 0.1);
  --border-focus: rgba(227, 24, 55, 0.65);
  --text: #f5f5f7;
  --text-muted: #a8adb8;
  --accent: #e31837;
  --accent-hover: #ff2d4d;
  --accent-soft: rgba(227, 24, 55, 0.14);
  --success: #3ecf8e;
  --error: #ff6b6b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --form-max: 920px;
  --section-gap: clamp(2rem, 4vw, 2.75rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(227, 24, 55, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(227, 24, 55, 0.06), transparent 50%),
    var(--bg);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.page-shell {
  width: min(100% - 2rem, calc(var(--form-max) + 4rem));
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.5rem) 0 clamp(3rem, 6vw, 4rem);
}

.site-brand {
  display: flex;
  justify-content: center;
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.site-brand img {
  width: min(280px, 72vw);
  height: auto;
  display: block;
}

.form-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.form-header {
  padding: clamp(1.75rem, 4vw, 2.5rem) clamp(1.5rem, 4vw, 2.75rem) 0;
  text-align: center;
}

.form-header h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.form-header .intro {
  margin: 0 auto;
  color: var(--text-muted);
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  font-weight: 500;
  max-width: 62ch;
  text-align: center;
}

.form-header .divider {
  margin: 1.5rem 0 0;
  border: 0;
  border-top: 1px solid var(--border);
}

form {
  padding: clamp(1.5rem, 4vw, 2.25rem) clamp(1.5rem, 4vw, 2.75rem) clamp(2rem, 4vw, 2.75rem);
}

.form-section {
  margin-bottom: var(--section-gap);
  padding-bottom: var(--section-gap);
  border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.section-label {
  margin: 0 0 1.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.field {
  margin-bottom: 1.35rem;
}

.field:last-child {
  margin-bottom: 0;
}

.field-grid {
  display: grid;
  gap: 1rem;
}

.field-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid--3 {
  grid-template-columns: 2fr 1fr 1fr;
}

@media (max-width: 720px) {
  .field-grid--2,
  .field-grid--3 {
    grid-template-columns: 1fr;
  }
}

label,
.legend {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.required-mark {
  color: var(--accent);
  margin-left: 0.15rem;
}

.hint {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.45;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  font: inherit;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-field);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder,
textarea::placeholder {
  color: #6b7280;
  font-weight: 400;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
  min-height: 7.5rem;
  resize: vertical;
}

select {
  cursor: pointer;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% + 2px),
    calc(100% - 12px) calc(50% + 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.25rem;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
}

.choice-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  background: var(--bg-field);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.choice-pill:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.choice-pill input {
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.choice-pill:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.55rem;
}

.choice-grid .choice-pill {
  border-radius: var(--radius-sm);
  justify-content: flex-start;
}

.keywords-grid {
  display: grid;
  gap: 0.65rem;
}

.keyword-row {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.65rem;
  align-items: center;
}

.keyword-row .num {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: right;
}

.is-hidden {
  display: none !important;
}

.conditional-block {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.file-drop {
  position: relative;
  padding: 2rem 1.25rem;
  text-align: center;
  background: var(--bg-field);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.file-drop.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-drop-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.7;
}

.file-drop strong {
  display: block;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.file-drop-sub {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
}

.field-hint-prominent {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}

.field-hint-prominent strong {
  color: var(--accent);
}

.file-list {
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-field);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.file-list-name {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-remove {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.file-remove:hover,
.file-remove:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.form-footer-note {
  margin: 0 0 1.5rem;
  padding: 1rem 1.15rem;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: justify;
  hyphens: auto;
}

.form-footer-note a {
  color: var(--accent);
  font-weight: 600;
}

/* Back to top — matches k-wired.com (d3d44d88.png) */
.back-to-top-wrap {
  position: fixed;
  right: clamp(60px, 5vw + 48px, 100px);
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.back-to-top-wrap.is-visible {
  opacity: 0.75;
  visibility: visible;
}

.back-to-top-wrap.is-visible:hover {
  opacity: 1;
}

.back-to-top-button {
  display: block;
  line-height: 0;
  text-decoration: none;
}

.back-to-top-button img {
  display: block;
  width: 80px;
  height: 80px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.75rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, #c41230 100%);
  box-shadow: 0 8px 24px rgba(227, 24, 55, 0.35);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(227, 24, 55, 0.42);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
}

.field-error {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--error);
}

.form-status {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
}

.form-status.is-error {
  background: rgba(255, 107, 107, 0.12);
  color: var(--error);
  border: 1px solid rgba(255, 107, 107, 0.35);
}

.form-status.is-success {
  background: rgba(62, 207, 142, 0.12);
  color: var(--success);
  border: 1px solid rgba(62, 207, 142, 0.35);
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .form-actions,
  .file-drop input {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn-primary:hover:not(:disabled) {
    transform: none;
  }
}
