@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #08080a;
  --panel: rgba(6, 6, 8, 0.78);
  --panel-border: rgba(255, 255, 255, 0.09);
  --text: #f5f5f7;
  --text-dim: rgba(245, 245, 247, 0.62);
  --text-faint: rgba(245, 245, 247, 0.38);
  --accent: #b98cff;
  --field-bg: rgba(255, 255, 255, 0.05);
  --field-border: rgba(255, 255, 255, 0.12);
  --field-border-focus: rgba(255, 255, 255, 0.32);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  position: relative;
  overflow-x: hidden;
}

/* Animerad neongradient-bakgrund */
.bg-gradient {
  position: fixed;
  inset: -10%;
  z-index: 0;
  background: conic-gradient(
    from 0deg at 50% 50%,
    #ff36e0,
    #ff8a3d,
    #ffe94d,
    #6dff5c,
    #4de0ff,
    #5c6bff,
    #ff36e0
  );
  filter: blur(120px) saturate(130%);
  opacity: 0.5;
  animation: rotateGradient 26s linear infinite;
}

@keyframes rotateGradient {
  to {
    transform: rotate(360deg);
  }
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 1;
  background-image: radial-gradient(rgba(0, 0, 0, 0.62) 0.9px, transparent 1.1px);
  background-size: 3px 3px;
}

.bg-scrim {
  display: none;
}

.page {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.logo {
  width: 168px;
  height: auto;
}

.card {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 32px;
}

.card h1 {
  margin: 0 0 24px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card .subtitle {
  margin: 0 0 26px;
  color: var(--text-dim);
  font-size: 13.5px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}

.select, .input {
  width: 100%;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  padding: 11px 13px;
  border-radius: 11px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.select::-ms-expand {
  display: none;
}

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7' fill='none'%3E%3Cpath d='M1 1L5.5 5.5L10 1' stroke='%23a0a0aa' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 34px;
}

.select:focus, .input:focus {
  border-color: var(--field-border-focus);
  background: rgba(255, 255, 255, 0.07);
}

.input:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.size-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.size-row .input {
  text-align: center;
}

.size-row .times {
  color: var(--text-faint);
  font-weight: 600;
}

.size-row .unit {
  color: var(--text-faint);
  font-size: 13px;
  white-space: nowrap;
}

.area-hint {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-faint);
}

.area-hint strong {
  color: var(--text-dim);
  font-weight: 600;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 11px;
  margin-bottom: 18px;
}

.checkbox-field input[type='checkbox'] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.checkbox-field .checkbox-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.checkbox-field .checkbox-title {
  font-size: 14px;
  font-weight: 600;
}

.checkbox-field .checkbox-desc {
  font-size: 12.5px;
  color: var(--text-faint);
  line-height: 1.45;
}

.divider {
  height: 1px;
  background: var(--panel-border);
  margin: 24px 0 20px;
}

.summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13.5px;
  color: var(--text-dim);
}

.summary-row .value {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.summary-row.total .value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.summary-row.total-label {
  font-size: 14px;
  color: var(--text-dim);
}

.summary-note {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: right;
}

.error-box {
  background: rgba(255, 80, 80, 0.12);
  border: 1px solid rgba(255, 80, 80, 0.3);
  color: #ffb4b4;
  font-size: 13px;
  padding: 12px 14px;
  border-radius: 11px;
  margin-bottom: 18px;
  display: none;
}

.error-box.visible {
  display: block;
}

.admin-corner-link {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: rgba(245, 245, 247, 0.14);
  transition: color 0.2s ease;
}

.admin-corner-link:hover {
  color: rgba(245, 245, 247, 0.5);
}

.back-corner-link {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--field-border);
  color: rgba(245, 245, 247, 0.55);
  transition: color 0.2s ease, background 0.2s ease;
}

.back-corner-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  background: #000;
  color: #fff;
  font-size: 11.5px;
  text-align: center;
  padding: 5px 12px;
}

@media (max-width: 480px) {
  .card {
    padding: 24px 18px;
  }
  .row-2 {
    grid-template-columns: 1fr;
  }
}

/* ---- Admin ---- */

.admin-body {
  align-items: flex-start;
  padding: 40px 16px;
}

.admin-page {
  max-width: 980px;
}

.admin-card {
  width: 100%;
}

.admin-login {
  max-width: 380px;
  margin: 0 auto;
}

.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 11px;
  border: 1px solid var(--field-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn.primary {
  background: var(--text);
  color: #0a0a0c;
  border-color: var(--text);
}

.btn.primary:hover {
  background: #dcdce0;
}

.btn.danger {
  border-color: rgba(255, 100, 100, 0.4);
  color: #ffb4b4;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}

.admin-tab {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--field-border);
  padding: 9px 15px;
  border-radius: 10px;
  cursor: pointer;
}

.admin-tab.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  white-space: nowrap;
}

th, td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--panel-border);
}

th {
  color: var(--text-faint);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 6px;
}

.pricing-grid input {
  width: 100%;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  color: var(--text);
  font-size: 12.5px;
  padding: 7px 8px;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}

.pricing-block {
  margin-bottom: 22px;
}

.pricing-block h4 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-dim);
}

.qty-labels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  font-size: 10.5px;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.simple-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.save-bar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  align-items: center;
}

.save-status {
  font-size: 12.5px;
  color: var(--text-faint);
}
