/* Mobile-first Funnel — Phase 1 PHP */

:root {
  --width-funnel: 430px;
  --min-height-touch: 3rem;
  --spacing-touch-gap: 0.75rem;
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-text: #18181b;
  --color-muted: #52525b;
  --color-border: #e4e4e7;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --font-size-title: max(1.5rem, 24px);
  --font-size-body: max(1rem, 16px);
}

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

html {
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--font-size-body);
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Public funnel shell */
.funnel-page-wrap {
  min-height: 100dvh;
  background: #f4f4f5;
}

@media (min-width: 1024px) {
  .funnel-page-wrap {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
  }
}

.funnel-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--width-funnel);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--color-surface);
}

@media (min-width: 1024px) {
  .funnel-shell {
    min-height: calc(100dvh - 2rem);
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    border: 1px solid var(--color-border);
  }
}

.funnel-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 3.5rem;
  border-bottom: 1px solid var(--color-border);
  background: rgb(255 255 255 / 0.95);
  backdrop-filter: blur(8px);
}

.funnel-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  min-width: 3rem;
  min-height: 3rem;
  border-radius: 0.5rem;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
}

.funnel-main {
  flex: 1;
  padding: 1.5rem 1rem;
}

.funnel-footer {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 1rem;
}

.funnel-footer nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.funnel-footer a {
  display: flex;
  align-items: center;
  min-height: var(--min-height-touch);
  padding: 0 0.5rem;
  font-size: var(--font-size-body);
  text-decoration: underline;
  text-underline-offset: 4px;
  color: var(--color-muted);
}

.funnel-title {
  margin: 0 0 0.5rem;
  font-size: var(--font-size-title);
  font-weight: 600;
  line-height: 1.25;
}

.funnel-body {
  margin: 0;
  font-size: var(--font-size-body);
  color: var(--color-muted);
}

.funnel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--min-height-touch);
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  background: var(--color-surface);
  font-size: var(--font-size-body);
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.funnel-btn:active {
  background: #f4f4f5;
}

.funnel-btn-primary {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

.funnel-btn-primary:active {
  background: var(--color-primary-hover);
}

.funnel-btn-stack {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-touch-gap);
}

.funnel-input {
  width: 100%;
  min-height: var(--min-height-touch);
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  font-size: var(--font-size-body);
}

.funnel-image-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0.75rem;
  background: #f4f4f5;
}

.funnel-center {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  text-align: center;
}

.funnel-app {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1.5rem;
}

.funnel-page-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.funnel-subtitle {
  margin: 0;
  font-size: 1.125rem;
  color: var(--color-muted);
}

.funnel-body-block {
  white-space: pre-wrap;
}

.funnel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.funnel-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.funnel-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.funnel-label {
  font-size: var(--font-size-body);
  font-weight: 500;
  color: var(--color-text);
}

.funnel-label-required::after {
  content: " *";
  color: #b45309;
}

.funnel-input,
.funnel-textarea {
  width: 100%;
  min-height: var(--min-height-touch);
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  font-size: var(--font-size-body);
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-surface);
}

.funnel-textarea {
  min-height: 6rem;
  resize: vertical;
}

.funnel-input:disabled,
.funnel-textarea:disabled {
  opacity: 0.7;
  background: #f4f4f5;
}

.funnel-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-height: var(--min-height-touch);
  padding: 0.25rem 0;
}

.funnel-checkbox-row input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  margin-top: 0.125rem;
  flex-shrink: 0;
  accent-color: var(--color-primary);
}

.funnel-checkbox-label {
  font-size: var(--font-size-body);
  line-height: 1.4;
  color: var(--color-text);
}

.funnel-error {
  margin: 0;
  font-size: 0.875rem;
  color: #b91c1c;
}

.funnel-success {
  margin: 0;
  padding: 1rem;
  border-radius: 0.75rem;
  background: #ecfdf5;
  color: #065f46;
  font-size: var(--font-size-body);
}

.funnel-form-submit {
  margin-top: 0.5rem;
}

.funnel-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.funnel-alert {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: #fef2f2;
  color: #991b1b;
  font-size: var(--font-size-body);
}

.funnel-btn-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.funnel-btn {
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 0.25rem;
}

.funnel-btn-label {
  font-weight: 600;
}

.funnel-btn-desc {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-muted);
}

.funnel-btn.is-selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgb(37 99 235 / 0.2);
}

.funnel-btn.is-loading {
  opacity: 0.85;
}

.funnel-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.funnel-btn-hint {
  margin: 0;
  padding: 0 0.25rem;
  font-size: 0.875rem;
  color: #b45309;
}

/* Admin (Phase 1 Platzhalter) */
.admin-wrap {
  min-height: 100dvh;
  background: #f4f4f5;
}

.admin-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

@media (min-width: 768px) {
  .admin-nav {
    top: 0;
    bottom: auto;
    width: 14rem;
    height: 100dvh;
    border-top: none;
    border-right: 1px solid var(--color-border);
  }

  .admin-main {
    margin-left: 14rem;
    padding: 1.5rem;
  }
}

.admin-nav ul {
  display: flex;
  justify-content: space-around;
  margin: 0;
  padding: 0.5rem;
  list-style: none;
}

@media (min-width: 768px) {
  .admin-nav ul {
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.25rem;
    padding: 0.75rem;
  }
}

.admin-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--min-height-touch);
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  font-size: var(--font-size-body);
  font-weight: 500;
  text-decoration: none;
  color: var(--color-muted);
}

@media (min-width: 768px) {
  .admin-nav a {
    justify-content: flex-start;
  }
}

.admin-nav a.is-active {
  background: #eff6ff;
  color: var(--color-primary);
}

.admin-main {
  padding: 1rem;
  padding-bottom: 5rem;
}

@media (min-width: 768px) {
  .admin-main {
    padding-bottom: 1.5rem;
  }
}

.admin-card {
  padding: 1.5rem;
  border-radius: 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.admin-badge {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  background: #e4e4e7;
  font-size: 0.875rem;
}

.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;
}
