/* ──────────────────────────────────────────────
   Present — Viewer Styles
   Clean, minimal, responsive with dark/light mode
   ────────────────────────────────────────────── */

:root {
  --color-bg: #ffffff;
  --color-surface: #f8f9fa;
  --color-border: #e2e8f0;
  --color-text: #1a202c;
  --color-text-muted: #718096;
  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-error: #ef4444;
  --color-error-bg: #fef2f2;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-border: #334155;
    --color-text: #f1f5f9;
    --color-text-muted: #94a3b8;
    --color-primary: #60a5fa;
    --color-primary-hover: #3b82f6;
    --color-error: #f87171;
    --color-error-bg: #1c1517;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  }
}

/* ── Reset ── */

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  height: 100%;
}

/* ── Landing Page ── */

.landing-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.landing-card {
  width: 100%;
  max-width: 560px;
  padding: 40px 32px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.landing-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.landing-title {
  margin-top: 18px;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.landing-copy {
  margin-top: 16px;
  max-width: 46ch;
  color: var(--color-text-muted);
  font-size: 1rem;
}

.landing-divider {
  margin: 24px 0 18px;
  height: 1px;
  background: var(--color-border);
}

.landing-help {
  color: var(--color-text);
  font-size: 0.95rem;
}

/* ── Prompt Container ── */

.prompt-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.prompt-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 40px 32px 32px;
  box-shadow: var(--shadow-card);
}

.prompt-header {
  text-align: center;
  margin-bottom: 28px;
}

.prompt-icon {
  width: 48px;
  height: 48px;
  color: var(--color-primary);
  margin-bottom: 16px;
}

.prompt-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
}

.prompt-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ── Form ── */

.prompt-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-group {
  position: relative;
}

.password-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.password-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.password-input::placeholder {
  color: var(--color-text-muted);
}

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

.submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  min-height: 48px;
}

.submit-btn:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

.submit-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Spinner ── */

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ── Error Message ── */

.error-message {
  margin-top: 16px;
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--color-error);
  background: var(--color-error-bg);
  border-radius: var(--radius-sm);
  text-align: center;
}

/* ── Shake Animation ── */

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

/* ── Fade Transitions ── */

.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Viewer Container ── */

.viewer-container {
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.content-frame {
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Footer ── */

.prompt-footer {
  margin-top: 24px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-align: center;
}

.prompt-footer strong {
  color: var(--color-text);
  font-weight: 600;
}

/* ── Utility ── */

.hidden {
  display: none !important;
}

/* ── Responsive ── */

@media (max-width: 480px) {
  .prompt-card {
    padding: 32px 20px 24px;
  }

  .prompt-title {
    font-size: 1.125rem;
  }
}
