:root {
  --bg: #f4f0e8;
  --panel: rgba(255, 252, 247, 0.92);
  --ink: #16221f;
  --muted: #5f6c67;
  --line: rgba(22, 34, 31, 0.12);
  --brand: #123d34;
  --brand-strong: #0c2a24;
  --accent: #c68a2a;
  --danger: #a33030;
  --shadow: 0 24px 80px rgba(17, 29, 26, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(198, 138, 42, 0.18), transparent 24%),
    radial-gradient(circle at bottom right, rgba(18, 61, 52, 0.14), transparent 26%),
    linear-gradient(135deg, #f7f2e8 0%, #efe8dc 48%, #f9f4ec 100%);
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 440px) 1fr;
}

.shell.app-mode {
  grid-template-columns: 1fr;
}

.auth-panel {
  padding: 48px 40px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.title {
  margin: 0;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.subtitle {
  margin: 18px 0 0;
  max-width: 28rem;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.login-card {
  margin-top: 32px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(18, 61, 52, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font: inherit;
}

.input:focus {
  outline: 2px solid rgba(198, 138, 42, 0.35);
  border-color: rgba(198, 138, 42, 0.8);
}

.button-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  cursor: pointer;
  font: inherit;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
}

.button-secondary {
  color: var(--brand);
  background: rgba(18, 61, 52, 0.08);
}

.status {
  min-height: 24px;
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
}

.status.success {
  color: var(--brand);
}

.viewer-shell {
  position: relative;
  min-height: 100vh;
  width: 100%;
}

.viewer-bar {
  position: absolute;
  inset: 18px 18px auto 18px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(12, 25, 22, 0.58);
  backdrop-filter: blur(18px);
  color: #f8f4ec;
}

.viewer-copy {
  min-width: 0;
}

.viewer-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.viewer-title {
  margin: 0;
  font-size: 16px;
}

.viewer-meta {
  margin: 4px 0 0;
  font-size: 13px;
  color: rgba(248, 244, 236, 0.78);
}

.viewer-logout {
  color: #f8f4ec;
  background: rgba(248, 244, 236, 0.12);
  border: 1px solid rgba(248, 244, 236, 0.14);
}

.viewer {
  width: 100%;
  height: 100vh;
  border: 0;
  background: #fff;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .shell.app-mode {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    min-height: 100vh;
    padding: 32px 22px;
  }

  .viewer-bar {
    inset: 12px 12px auto 12px;
    align-items: flex-start;
    flex-direction: column;
  }
}
