/* ========================================
   交房助手 · 样式表
   设计语调：温暖、克制、有质感
   像建筑杂志和高级民宿欢迎册的结合
   ======================================== */

/* ---------- 设计变量 ---------- */
:root {
  /* 色彩 */
  --bg: #F5EFE3;
  --bg-soft: #EFE8D8;
  --surface: #FCF9F2;
  --ink: #1A1410;
  --ink-soft: #5E5448;
  --ink-faded: #968874;
  --line: #E3D9C5;
  --line-soft: #EDE5D2;
  --accent: #A8472A;
  --accent-soft: #D9805F;
  --accent-bg: #F1E1D4;
  --warn: #8B6F1F;

  /* 字体 */
  --font-display: 'Noto Serif SC', 'Cormorant Garamond', 'STSong', serif;
  --font-body: 'Noto Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'SF Mono', Menlo, monospace;

  /* 间距与圆角 */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

/* ---------- 基础重置 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  letter-spacing: 0.01em;
  min-height: 100vh;
  /* 背景纹理：极淡的颗粒感，模仿米白色棉麻纸 */
  background-image:
    radial-gradient(at 20% 10%, rgba(168, 71, 42, 0.04) 0px, transparent 50%),
    radial-gradient(at 80% 80%, rgba(168, 71, 42, 0.03) 0px, transparent 50%);
}

/* ---------- 加载与错误状态 ---------- */
.loading-screen, .error-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: var(--bg);
  color: var(--ink-soft);
  text-align: center;
  padding: 2rem;
  z-index: 1000;
}

/* 关键修复：让 HTML 的 hidden 属性能真正生效 */
.loading-screen[hidden],
.error-screen[hidden] {
  display: none;
}

.loading-mark {
  color: var(--accent);
  animation: house-breathe 2.4s ease-in-out infinite;
}

@keyframes house-breathe {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(-4px); opacity: 1; }
}

.loading-text {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.05em;
}

.error-content h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.error-content p {
  color: var(--ink-soft);
  max-width: 32ch;
}

/* ---------- 主容器 ---------- */
main {
  max-width: 560px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 6rem;
}

@media (min-width: 600px) {
  main {
    padding: 2.5rem 2rem 6rem;
  }
}

/* ---------- 顶部欢迎区 ---------- */
.hero {
  padding: 1rem 0 2rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.hero-eyebrow .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.hero-address {
  font-size: 0.875rem;
  color: var(--ink-faded);
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

.hero-welcome {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.75;
  max-width: 38ch;
}

/* ---------- 卡片通用 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 0 rgba(26, 20, 16, 0.02);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.card-header h2 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
}

/* ---------- 速查信息表 ---------- */
.edit-toggle {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 0.3rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s;
}

.edit-toggle:hover, .edit-toggle.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 0.85rem;
}

.info-item-wide {
  grid-column: span 2;
}

.info-item label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-faded);
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.info-item input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 0.4rem 0;
  transition: border-color 0.2s;
}

.info-item input:read-only {
  cursor: default;
}

.info-item input:not(:read-only) {
  border-bottom-color: var(--accent-soft);
  background: var(--accent-bg);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  border-bottom-style: dashed;
}

.info-item input:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.info-item input::placeholder {
  color: var(--ink-faded);
  opacity: 0.5;
}

.info-hint {
  font-size: 0.75rem;
  color: var(--ink-faded);
  margin-top: 1.25rem;
  line-height: 1.6;
}

/* ---------- 笔记区 ---------- */
.notes-card textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  resize: vertical;
  min-height: 8rem;
  line-height: 1.7;
  transition: border-color 0.2s;
}

.notes-card textarea:focus {
  outline: none;
  border-color: var(--accent-soft);
  border-style: solid;
  background: var(--surface);
}

.notes-card textarea::placeholder {
  color: var(--ink-faded);
  white-space: pre-line;
}

/* ---------- 电器列表 ---------- */
.appliance-list {
  list-style: none;
}

.appliance-list li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.appliance-list li:last-child {
  border-bottom: none;
}

.appliance-name {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.appliance-meta {
  font-size: 0.8rem;
  color: var(--ink-faded);
}

/* ---------- 聊天区 ---------- */
.chat-section {
  margin-top: 2.5rem;
}

.chat-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.chat-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.chat-header p {
  font-size: 0.85rem;
  color: var(--ink-faded);
}

/* 建议问题芯片 */
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.chat-suggestions button {
  font-family: var(--font-body);
  font-size: 0.8rem;
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 0.45rem 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1.4;
}

.chat-suggestions button:hover {
  background: var(--accent-bg);
  border-color: var(--accent-soft);
  color: var(--ink);
}

/* 消息列表 */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
  min-height: 100px;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 90%;
  animation: message-in 0.3s ease;
}

@keyframes message-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-user {
  align-self: flex-end;
  align-items: flex-end;
}

.message-assistant {
  align-self: flex-start;
}

.message-role {
  font-size: 0.7rem;
  color: var(--ink-faded);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.message-bubble {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message-user .message-bubble {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.message-assistant .message-bubble {
  background: var(--surface);
}

.message-typing .message-bubble::after {
  content: '●';
  display: inline-block;
  animation: typing 1.2s infinite;
  color: var(--ink-faded);
  margin-left: 0.25rem;
}

@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}

/* 输入框 */
.chat-input {
  position: sticky;
  bottom: 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 0.5rem 0.5rem 0.5rem 1.1rem;
  box-shadow: 0 4px 20px rgba(26, 20, 16, 0.06);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input:focus-within {
  border-color: var(--accent-soft);
  box-shadow: 0 4px 24px rgba(168, 71, 42, 0.12);
}

.chat-input textarea {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink);
  background: transparent;
  border: none;
  resize: none;
  padding: 0.5rem 0;
  max-height: 120px;
  outline: none;
}

.chat-input textarea::placeholder {
  color: var(--ink-faded);
}

.chat-input button {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}

.chat-input button:hover:not(:disabled) {
  background: #8E3920;
}

.chat-input button:active:not(:disabled) {
  transform: scale(0.95);
}

.chat-input button:disabled {
  background: var(--line);
  cursor: not-allowed;
}

/* ---------- 页脚 ---------- */
.page-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

.page-footer p {
  font-size: 0.75rem;
  color: var(--ink-faded);
  line-height: 1.6;
}

/* ---------- 语言切换按钮 ---------- */
.lang-switcher {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.lang-btn {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  color: var(--ink-faded);
  border-radius: 4px;
  transition: all 0.15s ease;
  letter-spacing: 0.02em;
}

.lang-btn:hover {
  color: var(--ink);
}

.lang-btn.active {
  color: var(--accent);
  background: var(--accent-bg);
}

.lang-divider {
  color: var(--line);
  font-size: 0.75rem;
  user-select: none;
}

@media (max-width: 480px) {
  .lang-switcher {
    top: 0.6rem;
    right: 0.6rem;
  }
  .lang-btn {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
}

/* ---------- 建造商落款 ---------- */
.hero-built-by {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--ink-faded);
  letter-spacing: 0.04em;
  font-style: italic;
}

/* ---------- Utilities 实用信息区块 ---------- */
.utility-static {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.utility-static:last-of-type {
  border-bottom: none;
}

.utility-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-faded);
  font-weight: 500;
}

.utility-value.code {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg-soft);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
}

.utility-providers {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

/* ---------- 户型图样式 ---------- */
.floorplan-card .floorplan-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0 0.5rem;
}

.floorplan-desc {
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.6;
}

.floorplan-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.5rem;
  background: var(--accent);
  color: white;
  border-radius: 100px;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: background 0.2s, transform 0.1s;
}

.floorplan-link:hover {
  background: #8E3920;
  transform: translateY(-1px);
}

.floorplan-link:active {
  transform: translateY(0);
}

.floorplan-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.floorplan-download {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--accent-soft);
}

.floorplan-download:hover {
  background: var(--accent-bg);
  color: #8E3920;
  transform: translateY(-1px);
}

/* ---------- 维修与维护 ---------- */
.services-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.service-item {
  padding: 0.75rem;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
}

.service-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.service-item input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 0.35rem 0;
  margin-bottom: 0.25rem;
}

.service-item input:last-of-type {
  margin-bottom: 0;
}

.service-item input:read-only {
  cursor: default;
}

.service-item input:not(:read-only) {
  border-bottom-color: var(--accent-soft);
  background: var(--surface);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
}

.service-item input:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.service-notes {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--ink-soft);
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 0.4rem;
  margin-top: 0.4rem;
  resize: vertical;
  min-height: 2rem;
  line-height: 1.5;
}

.service-notes:focus {
  outline: none;
  border-color: var(--accent-soft);
  border-style: solid;
  background: var(--surface);
}

.service-notes:read-only {
  cursor: default;
  border-color: transparent;
  background: transparent;
  padding: 0.4rem 0;
}

.service-notes:not(:read-only) {
  border-color: var(--accent-soft);
  background: var(--surface);
  padding: 0.4rem;
}

.service-item.service-hidden {
  display: none;
}

.service-toggle {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.65rem 0;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--accent);
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

.service-toggle:hover {
  background: var(--accent-bg);
  border-color: var(--accent-soft);
  border-style: solid;
}

.service-toggle.expanded {
  border-color: var(--line);
  color: var(--ink-faded);
}

.service-toggle.expanded:hover {
  background: var(--bg-soft);
  border-style: dashed;
}

/* ---------- 电器折叠样式 ---------- */
.appliance-list li.appliance-hidden {
  display: none;
}

.appliance-toggle {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.65rem 0;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--accent);
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

.appliance-toggle:hover {
  background: var(--accent-bg);
  border-color: var(--accent-soft);
  border-style: solid;
}

.appliance-toggle.expanded {
  border-color: var(--line);
  color: var(--ink-faded);
}

.appliance-toggle.expanded:hover {
  background: var(--bg-soft);
  border-style: dashed;
}

/* ---------- 聊天历史截断样式 ---------- */
.chat-history-toggle {
  display: block;
  width: 100%;
  padding: 0.6rem 0;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--ink-faded);
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

.chat-history-toggle:hover {
  background: var(--bg-soft);
  border-style: solid;
  color: var(--ink-soft);
}

.chat-history-toggle.expanded {
  color: var(--ink-faded);
}

/* ---------- 暗色模式（可选，跟随系统） ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1A1612;
    --bg-soft: #221C16;
    --surface: #25201A;
    --ink: #F5EFE3;
    --ink-soft: #C4B6A2;
    --ink-faded: #8A7B6A;
    --line: #3A3128;
    --line-soft: #2C2620;
    --accent: #D9805F;
    --accent-soft: #B8593A;
    --accent-bg: #2E2218;
  }

  body {
    background-image:
      radial-gradient(at 20% 10%, rgba(217, 128, 95, 0.05) 0px, transparent 50%),
      radial-gradient(at 80% 80%, rgba(217, 128, 95, 0.04) 0px, transparent 50%);
  }

  .message-user .message-bubble {
    color: var(--ink);
  }
}

/* ---------- 同步状态条 ---------- */
.sync-bar {
  margin-top: 1.5rem;
  margin-bottom: -0.5rem;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  border-radius: 100px;
  font-size: 0.8rem;
  border: 1px solid var(--line);
  background: var(--surface);
}

.sync-status.sync-cloud {
  background: var(--accent-bg);
  border-color: var(--accent-soft);
}

.sync-status.sync-local {
  background: var(--bg-soft);
}

.sync-icon {
  flex-shrink: 0;
  font-size: 0.95rem;
  line-height: 1;
}

.sync-icon-cloud { color: var(--accent); }
.sync-icon-phone { color: var(--ink-faded); }

.sync-text {
  flex: 1;
  color: var(--ink-soft);
  line-height: 1.4;
}

.sync-email {
  color: var(--ink);
  font-weight: 500;
}

.sync-action {
  flex-shrink: 0;
  font-family: var(--font-body);
  font-size: 0.75rem;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 0.25rem 0.75rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s;
}

.sync-action:hover {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.sync-status.sync-local .sync-action {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.sync-status.sync-local .sync-action:hover {
  background: #8E3920;
  border-color: #8E3920;
}

/* ---------- 登录弹窗 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 20, 16, 0.5);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(4px);
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  max-width: 420px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(26, 20, 16, 0.2);
  animation: modal-in 0.25s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.75rem;
  color: var(--ink-faded);
  cursor: pointer;
  width: 32px;
  height: 32px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { color: var(--ink); }

.modal h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.6rem;
  text-align: center;
}

.modal-lead {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.65;
  text-align: center;
  margin-bottom: 1.5rem;
}

.modal-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-faded);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.modal input[type="email"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.2s;
}

.modal input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.modal-submit {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.modal-submit:hover:not(:disabled) {
  background: #8E3920;
}

.modal-submit:disabled {
  background: var(--ink-faded);
  cursor: not-allowed;
}

.modal-fineprint {
  font-size: 0.75rem;
  color: var(--ink-faded);
  text-align: center;
  margin-top: 1.25rem;
  line-height: 1.5;
}

.modal-icon {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.modal-icon.spinning {
  display: block;
  animation: spin 1.2s linear infinite;
}

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

.link-button {
  background: transparent;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.magic-link-box {
  margin-top: 1rem;
  padding: 0.85rem;
  background: var(--accent-bg);
  border-radius: var(--radius-md);
  text-align: center;
}

.magic-link-label {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.magic-link-url {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--accent);
  word-break: break-all;
  text-decoration: underline;
  font-weight: 500;
}
