/* === WebKracht12 Self-Service PWA === */

:root {
  --wk-primary: #E94B8C;
  --wk-primary-dark: #C54BBB;
  --wk-gradient: linear-gradient(90deg, #FFA726 0%, #FF6B6B 35%, #E94B8C 65%, #C54BBB 100%);
  --wk-bg: #ffffff;
  --wk-bg-alt: #F9FAFB;
  --wk-text: #1F2937;
  --wk-text-light: #6B7280;
  --wk-border: #E5E7EB;
  --wk-success: #10B981;
  --wk-error: #EF4444;
  --wk-radius: 12px;
  --wk-radius-sm: 8px;
  --wk-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --wk-shadow-lg: 0 10px 30px rgba(255, 107, 107, 0.25);
  --wk-safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--wk-text);
  background-color: var(--wk-bg-alt);
  min-height: 100dvh;
  overscroll-behavior: none;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--wk-bg);
  position: relative;
}

/* === Screens === */
.screen { display: none; }
.screen.active { display: block; }

/* === Login === */
.login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 2rem;
  text-align: center;
}

.login__logo { margin-bottom: 1rem; }

.login__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.login__subtitle {
  color: var(--wk-text-light);
  margin-bottom: 2rem;
}

.login__form {
  width: 100%;
  max-width: 320px;
  text-align: left;
}

.login__message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--wk-radius-sm);
  font-size: 0.875rem;
}

.login__message--success {
  background: #f0fdf4;
  color: var(--wk-success);
}

.login__message--error {
  background: #fef2f2;
  color: var(--wk-error);
}

/* === Topbar === */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--wk-bg);
  border-bottom: 1px solid var(--wk-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__title {
  font-size: 1.125rem;
  font-weight: 600;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar__link {
  font-size: 0.875rem;
  color: var(--wk-primary);
  text-decoration: none;
  font-weight: 500;
}

.topbar__logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--wk-text-secondary, #6B7280);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.topbar__logout:hover {
  background: var(--wk-bg-secondary, #F3F4F6);
  color: var(--wk-text, #1F2937);
}

/* === Tabbar === */
.tabbar {
  display: flex;
  background: var(--wk-bg);
  border-bottom: 1px solid var(--wk-border);
  position: sticky;
  top: 3.5rem;
  z-index: 10;
}

.tabbar__tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0;
  border: none;
  background: none;
  color: var(--wk-text-light);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
  border-bottom: 2px solid transparent;
}

.tabbar__tab.active {
  color: var(--wk-primary);
  border-bottom-color: var(--wk-primary);
}

.tabbar__tab svg {
  width: 22px;
  height: 22px;
}

/* === Tab Panels === */
.tab-panel { display: none; padding-bottom: calc(2rem + var(--wk-safe-bottom)); }
.tab-panel.active { display: block; }

/* === Panels === */
.panel {
  padding: 1.25rem;
  border-bottom: 8px solid var(--wk-bg-alt);
}

.panel__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.panel__hint {
  font-size: 0.875rem;
  color: var(--wk-text-light);
  margin-bottom: 1rem;
}

.panel__optional {
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--wk-text-light);
}

.service-card__detail {
  margin-top: 0.5rem;
  border-top: 1px solid var(--wk-border);
  padding-top: 0.5rem;
}

.service-card__detail-toggle {
  font-size: 0.8125rem;
  color: var(--wk-primary);
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}

.service-card__detail-toggle:hover {
  text-decoration: underline;
}

/* === Form Elements === */
.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--wk-text-light);
  margin-bottom: 0.375rem;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--wk-border);
  border-radius: var(--wk-radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--wk-text);
  background: var(--wk-bg);
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--wk-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea { resize: vertical; min-height: 100px; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--wk-radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  min-height: 48px; /* Touch target */
}

.btn--primary {
  background: var(--wk-gradient);
  color: white;
}

.btn--primary:hover { box-shadow: var(--wk-shadow-lg); }
.btn--primary:active { transform: scale(0.98); }

.btn--outline {
  background: transparent;
  color: var(--wk-primary);
  border: 1.5px solid var(--wk-primary);
}

.btn--outline:hover { background: rgba(37, 99, 235, 0.05); }

.btn--full { width: 100%; }

.btn--danger {
  background: var(--wk-error);
  color: white;
}

/* === Actions bar === */
.actions {
  display: flex;
  gap: 0.75rem;
  padding: 1.25rem;
  background: var(--wk-bg);
  border-top: 1px solid var(--wk-border);
  position: sticky;
  bottom: 0;
  padding-bottom: calc(1.25rem + var(--wk-safe-bottom));
}

.actions .btn { flex: 1; }

/* === Upload Area === */
.upload-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.upload-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
  border: 2px dashed var(--wk-border);
  border-radius: var(--wk-radius);
  background: var(--wk-bg-alt);
  color: var(--wk-text-light);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 120px;
}

.upload-btn:hover {
  border-color: var(--wk-primary);
  color: var(--wk-primary);
  background: rgba(37, 99, 235, 0.03);
}

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

.upload-btn svg {
  stroke: currentColor;
}

/* === Upload Progress === */
.upload-progress {
  margin-top: 1rem;
}

.upload-progress__bar {
  height: 6px;
  background: var(--wk-border);
  border-radius: 3px;
  overflow: hidden;
}

.upload-progress__fill {
  height: 100%;
  background: var(--wk-primary);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.upload-progress__text {
  font-size: 0.8125rem;
  color: var(--wk-text-light);
  margin-top: 0.5rem;
  text-align: center;
}

/* === Photo Grid === */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.photo-grid__empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--wk-text-light);
  padding: 2rem;
  font-size: 0.875rem;
}

.photo-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--wk-radius-sm);
  overflow: hidden;
  background: var(--wk-bg-alt);
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-card__delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-card__label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.25rem 0.5rem;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 0.6875rem;
  text-align: center;
}

/* === Service Card === */
.service-card {
  background: var(--wk-bg-alt);
  border-radius: var(--wk-radius-sm);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.service-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.service-card__remove {
  background: none;
  border: none;
  color: var(--wk-text-light);
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 0.25rem;
}

.service-card__remove:hover { color: var(--wk-error); }

/* === Toast === */
.toast {
  position: fixed;
  bottom: calc(5rem + var(--wk-safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--wk-text);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--wk-radius);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--wk-shadow-lg);
  z-index: 100;
  animation: toast-in 0.3s ease;
  max-width: calc(100% - 2rem);
}

.toast--success { background: var(--wk-success); }
.toast--error { background: var(--wk-error); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* === Loading spinner === */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* === Language Tabs (meertalig) === */
.lang-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--wk-border);
}

.lang-tabs__tab {
  padding: 0.5rem 1.5rem;
  border: none;
  background: none;
  color: var(--wk-text-light);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
  min-height: 40px;
}

.lang-tabs__tab:hover {
  color: var(--wk-text);
}

.lang-tabs__tab.active {
  color: var(--wk-primary);
  border-bottom-color: var(--wk-primary);
}

.lang-fields[hidden] {
  display: none;
}

.lang-panel {
  display: none;
}

.lang-panel.active {
  display: block;
}

/* === Preview Topbar === */
.preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--wk-bg);
  border-bottom: 1px solid var(--wk-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.preview-topbar__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--wk-text);
}

.preview-topbar .btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  min-height: 40px;
}

/* === Preview Frame === */
.preview-frame {
  display: flex;
  justify-content: center;
  padding: 1rem;
  background: var(--wk-bg-alt);
  min-height: calc(100dvh - 65px);
}

.preview-frame iframe {
  width: 100%;
  max-width: 480px;
  height: calc(100dvh - 97px);
  border: none;
  border-radius: var(--wk-radius);
  background: #fff;
  box-shadow:
    0 0 0 1px var(--wk-border),
    0 4px 24px rgba(0, 0, 0, 0.08);
}

/* Op smal scherm: volle breedte, geen padding rondom */
@media (max-width: 520px) {
  .preview-frame {
    padding: 0;
  }

  .preview-frame iframe {
    max-width: 100%;
    border-radius: 0;
    height: calc(100dvh - 65px);
    box-shadow: none;
  }
}

/* === Responsive === */
@media (max-width: 360px) {
  .panel { padding: 1rem; }
  .actions { padding: 1rem; }
}
