/* =========================================================
   IT Support Issue Report Form — Stylesheet
   Corporate design system with light/dark theme support
   ========================================================= */

:root {
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-input-hover: #f8fafc;
  --border-color: #e2e8f0;
  --border-color-strong: #cbd5e1;
  --text-heading: #0f172a;
  --text-body: #1e293b;
  --text-muted: #64748b;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-soft: #eff6ff;
  --brand-soft-border: #bfdbfe;
  --shadow-color: 220 30% 60%;
  --focus-ring: #93c5fd;
}

html.dark {
  --bg-page: #0b1220;
  --bg-card: #131c2e;
  --bg-input: #0f1729;
  --bg-input-hover: #182338;
  --border-color: #253148;
  --border-color-strong: #35435f;
  --text-heading: #f1f5f9;
  --text-body: #e2e8f0;
  --text-muted: #8b98b0;
  --brand: #3b82f6;
  --brand-strong: #60a5fa;
  --brand-soft: #17233c;
  --brand-soft-border: #2c3f63;
  --shadow-color: 220 50% 4%;
  --focus-ring: #3b82f6;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-page);
  color: var(--text-body);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Background decoration ---------- */
.bg-decoration {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(600px circle at 15% -5%, var(--brand-soft), transparent 60%),
    radial-gradient(500px circle at 100% 10%, var(--brand-soft), transparent 55%);
  opacity: 0.9;
}

.relative { position: relative; z-index: 1; }

/* ---------- Card Surfaces ---------- */
.card-surface {
  background-color: var(--bg-card);
  border-color: var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.section-card:hover {
  box-shadow: 0 8px 24px -12px hsl(var(--shadow-color) / 0.35);
}

/* ---------- Header ---------- */
.header-icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #ffffff;
  box-shadow: 0 6px 16px -4px hsl(var(--shadow-color) / 0.45);
}

.brand-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.brand-wordmark {
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: none;
  font-size: 0.8125rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-divider {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background-color: var(--text-muted);
  opacity: 0.6;
  flex-shrink: 0;
}

.text-heading { color: var(--text-heading); }
.text-body { color: var(--text-body); }
.text-muted { color: var(--text-muted); }

/* ---------- Theme Toggle ---------- */
.theme-toggle-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color-strong);
  color: var(--text-body);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.theme-toggle-btn:hover {
  background-color: var(--bg-input-hover);
  transform: translateY(-1px);
}

.theme-toggle-btn:active {
  transform: translateY(0) scale(0.95);
}

.theme-toggle-btn .icon-sun,
.theme-toggle-btn .icon-moon {
  position: absolute;
  transition: opacity 0.25s ease, transform 0.35s ease;
}

.theme-toggle-btn .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
  color: #f59e0b;
}

.theme-toggle-btn .icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
  color: #93c5fd;
}

html.dark .theme-toggle-btn .icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

html.dark .theme-toggle-btn .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* ---------- Section Header ---------- */
.section-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
}

@media (min-width: 640px) {
  .section-header { padding: 28px 32px 4px; }
}

.section-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 9px;
  background-color: var(--brand-soft);
  border: 1px solid var(--brand-soft-border);
  color: var(--brand);
  font-weight: 700;
  font-size: 0.875rem;
}

.section-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- Form Fields ---------- */
.field-group {
  display: flex;
  flex-direction: column;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-body);
  margin-bottom: 6px;
}

.field-icon {
  width: 15px;
  height: 15px;
  color: var(--brand);
  flex-shrink: 0;
}

.required-star {
  color: #ef4444;
}

.field-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.875rem;
  border-radius: 10px;
  border: 1px solid var(--border-color-strong);
  background-color: var(--bg-input);
  color: var(--text-body);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.3s ease;
  font-family: inherit;
}

.field-input::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.field-input:hover {
  background-color: var(--bg-input-hover);
}

.field-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.field-input:invalid.touched {
  border-color: #ef4444;
}

select.field-input {
  cursor: pointer;
}

textarea.field-input {
  font-family: inherit;
  line-height: 1.5;
}

.field-helper {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 5px;
}

.char-counter {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  margin-top: 5px;
}

.char-counter.char-counter-warn {
  color: #f59e0b;
  font-weight: 600;
}

.char-counter.char-counter-max {
  color: #ef4444;
  font-weight: 600;
}

/* ---------- Priority Radio Group ---------- */
.priority-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 480px) {
  .priority-group {
    grid-template-columns: repeat(4, 1fr);
  }
}

.priority-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1.5px solid var(--border-color-strong);
  background-color: var(--bg-input);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.priority-option::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
  opacity: 0.5;
}

.priority-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.priority-option:hover {
  background-color: var(--bg-input-hover);
}

.priority-option:has(input:checked) {
  color: #ffffff;
  border-color: transparent;
}

.priority-option:has(input:checked)::before {
  opacity: 1;
}

.priority-low:has(input:checked) { background-color: #16a34a; }
.priority-medium:has(input:checked) { background-color: #d97706; }
.priority-high:has(input:checked) { background-color: #ea580c; }
.priority-critical:has(input:checked) { background-color: #dc2626; }

.priority-option:has(input:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- File Upload ---------- */
.file-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  border: 1.5px dashed var(--border-color-strong);
  border-radius: 12px;
  background-color: var(--bg-input);
  color: var(--text-body);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.file-drop-zone:hover {
  border-color: var(--brand);
  background-color: var(--brand-soft);
}

.file-drop-zone i {
  color: var(--brand);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Agreement Checkbox ---------- */
.agreement-checkbox {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 2px;
  border-radius: 5px;
  border: 1.5px solid var(--border-color-strong);
  background-color: var(--bg-input);
  cursor: pointer;
  accent-color: var(--brand);
}

/* ---------- Buttons ---------- */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #ffffff;
  box-shadow: 0 6px 16px -6px hsl(var(--shadow-color) / 0.55);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -8px hsl(var(--shadow-color) / 0.6);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-secondary {
  background-color: var(--bg-input);
  color: var(--text-body);
  border-color: var(--border-color-strong);
}

.btn-secondary:hover {
  background-color: var(--bg-input-hover);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0) scale(0.98);
}

/* ---------- Focus visibility for accessibility ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
label:focus-within {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- SweetAlert2 theme overrides ---------- */
.swal2-popup.corporate-popup {
  border-radius: 14px !important;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif !important;
}

html.dark .swal2-popup.corporate-popup {
  background-color: #131c2e !important;
  color: #e2e8f0 !important;
}

html.dark .swal2-popup.corporate-popup .swal2-html-container {
  color: #8b98b0 !important;
}