/* ==========================================================================
   Introvert Notes - Mobile-First Minimalist PWA Stylesheet
   Brand Colors: #112c4e (Deep Navy), #fcfeff (Ice White), #915d2f (Terracotta/Bronze)
   ========================================================================== */

:root {
  /* Introvert Brand Identity Palette */
  --brand-navy: #112c4e;
  --brand-white: #fcfeff;
  --brand-terracotta: #915d2f;
  --brand-terracotta-light: #b67a42;
  --brand-terracotta-dark: #6e431d;

  /* LIGHT THEME (Default) */
  --bg-main: #fcfeff;
  --bg-surface: #f3f6fb;
  --bg-card: #ffffff;
  --bg-card-hover: #edf3fa;
  --bg-nav: rgba(252, 254, 255, 0.88);
  --border-color: rgba(17, 44, 78, 0.12);
  --border-focus: #915d2f;

  --text-primary: #112c4e;
  --text-secondary: #3e5370;
  --text-muted: #72859f;

  --accent-red: #d32f2f;
  --accent-red-hover: #b71c1c;
  --accent-red-glow: rgba(211, 47, 47, 0.35);

  --accent-primary: #915d2f;
  --accent-primary-hover: #784b23;
  --accent-ai: #915d2f;
  --accent-success: #059669;
  --accent-warning: #d97706;

  --btn-icon-bg: rgba(17, 44, 78, 0.05);
  --btn-icon-hover: rgba(17, 44, 78, 0.1);
  --shadow-card: 0 4px 16px rgba(17, 44, 78, 0.07);
  --shadow-modal: 0 -10px 40px rgba(17, 44, 78, 0.16);

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Monaco, Consolas, monospace;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
  /* DARK THEME */
  --bg-main: #0a1728;
  --bg-surface: #112c4e;
  --bg-card: #152b47;
  --bg-card-hover: #1b3659;
  --bg-nav: rgba(10, 23, 40, 0.88);
  --border-color: rgba(252, 254, 255, 0.12);
  --border-focus: #b67a42;

  --text-primary: #fcfeff;
  --text-secondary: #c2d2e5;
  --text-muted: #8298b5;

  --accent-red: #ef4444;
  --accent-red-hover: #dc2626;
  --accent-red-glow: rgba(239, 68, 68, 0.4);

  --accent-primary: #b67a42;
  --accent-primary-hover: #cb8b52;
  --accent-ai: #d4955b;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;

  --btn-icon-bg: rgba(252, 254, 255, 0.08);
  --btn-icon-hover: rgba(252, 254, 255, 0.16);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-modal: 0 -10px 40px rgba(0, 0, 0, 0.6);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-family);
  overflow-x: hidden;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  background-color: var(--bg-main);
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

/* Top Navigation */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.brand {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
}

/* Brand Logo Image */
.brand-logo-img {
  height: 32px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
  display: block;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.brand:hover .brand-logo-img {
  opacity: 0.85;
}

/* In dark theme, invert the navy mark to pure white */
[data-theme="dark"] .brand-logo-img {
  filter: brightness(0) invert(1);
}

/* Brand Logo Mark -[ i ]- */
.brand-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  user-select: none;
  box-shadow: 0 2px 5px rgba(17, 44, 78, 0.05);
  transition: all 0.2s ease;
}

.logo-dash {
  color: var(--text-muted);
  opacity: 0.8;
}

.logo-bracket {
  color: var(--text-secondary);
  font-weight: 800;
}

.logo-letter {
  color: var(--brand-terracotta);
  font-weight: 900;
  margin: 0 1px;
}

[data-theme="dark"] .logo-letter {
  color: var(--brand-terracotta-light);
}

.brand-name {
  display: none !important;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Icon Buttons */
.icon-btn {
  background: var(--btn-icon-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: var(--btn-icon-hover);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: scale(0.96);
}

.icon-btn.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.3);
}

.icon-btn.small {
  width: 30px;
  height: 30px;
  font-size: 18px;
}

.badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--accent-primary);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-main);
}

/* Main Content Views */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.view {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 20px;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.view.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   SCREEN 1: Record View (Minimalist & Focused)
   ========================================================================== */
.record-view-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  padding: 20px 0;
  min-height: 520px;
}

/* Status Indicator */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  box-shadow: 0 2px 8px rgba(17, 44, 78, 0.04);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-success);
  transition: all 0.3s ease;
}

.status-dot.ready {
  background: var(--accent-success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.status-dot.recording {
  background: var(--accent-red);
  box-shadow: 0 0 12px var(--accent-red);
  animation: blink 1s infinite;
}

.status-dot.processing {
  background: var(--accent-ai);
  box-shadow: 0 0 12px var(--accent-ai);
  animation: pulseAi 1.5s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.85); }
}

@keyframes pulseAi {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* Timer Display */
.timer-wrapper {
  margin-top: 10px;
}

.record-timer {
  font-size: 3.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Big Red Record Button & Canvas Area */
.record-btn-container {
  position: relative;
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
}

.audio-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
}

/* The Large Record Button */
.record-btn {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 2;
  box-shadow: 0 12px 36px var(--accent-red-glow), 0 0 0 6px rgba(239, 68, 68, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
}

.record-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 16px 48px var(--accent-red-glow), 0 0 0 8px rgba(239, 68, 68, 0.25);
}

.record-btn:active {
  transform: scale(0.96);
}

.record-btn.recording {
  background: linear-gradient(135deg, #b91c1c, #991b1b);
  box-shadow: 0 0 50px rgba(239, 68, 68, 0.6), 0 0 0 12px rgba(239, 68, 68, 0.25);
  animation: pulse-ring 2s infinite ease-out;
}

.record-btn.processing {
  pointer-events: none;
  background: linear-gradient(135deg, #4338ca, #312e81);
  box-shadow: 0 12px 36px rgba(99, 102, 241, 0.35);
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5), 0 12px 36px var(--accent-red-glow);
  }
  70% {
    box-shadow: 0 0 0 32px rgba(239, 68, 68, 0), 0 12px 36px var(--accent-red-glow);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0), 0 12px 36px var(--accent-red-glow);
  }
}

.record-btn-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.stop-icon {
  width: 38px;
  height: 38px;
  background-color: white;
  border-radius: 8px;
}

/* Spinner for AI processing */
.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Dynamic Prompt Hint */
.prompt-hint-container {
  max-width: 320px;
  text-align: center;
}

.prompt-hint {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Latest Note Quick Banner */
.latest-note-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.latest-note-banner:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus);
}

.latest-note-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-right: 12px;
}

.latest-note-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.latest-note-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   SCREEN 2: Library & Notes History
   ========================================================================== */
.library-view-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
}

.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.view-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  gap: 10px;
  transition: border-color 0.2s;
}

.search-bar:focus-within {
  border-color: var(--border-focus);
}

.search-icon {
  color: var(--text-muted);
}

.search-bar input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  width: 100%;
}

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

.clear-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 4px;
}

/* Notes List & Cards */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 24px;
}

.note-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  box-shadow: var(--shadow-card);
}

.note-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  transform: translateY(-2px);
}

.note-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.note-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.note-card-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.note-card-summary {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.note-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag-badge {
  background: rgba(145, 93, 47, 0.12);
  color: var(--accent-primary);
  border: 1px solid rgba(145, 93, 47, 0.25);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.card-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon {
  margin-bottom: 16px;
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.9rem;
  max-width: 280px;
  line-height: 1.4;
}

/* ==========================================================================
   MODAL / BOTTOM SHEET (Note Detail & Settings)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: overlayFadeIn 0.2s ease-out;
}

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

.modal-card {
  width: 100%;
  max-width: 640px;
  max-height: 94vh;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-modal);
  animation: slideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: env(safe-area-inset-bottom, 8px);
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
    padding: 20px;
  }
  .modal-card {
    border-radius: var(--radius-lg);
    max-height: 85vh;
  }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.detail-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Detail Card Body Elements */
.detail-title-wrap {
  padding: 16px 20px 8px;
}

.detail-title-input {
  width: 100%;
  background: transparent;
  border: none;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  outline: none;
  border-bottom: 1px dashed transparent;
  padding-bottom: 4px;
}

.detail-title-input:focus {
  border-bottom-color: var(--border-focus);
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Audio Player */
.audio-player {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  margin: 10px 20px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(17, 44, 78, 0.04);
}

.audio-play-btn {
  width: 36px;
  height: 36px;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.audio-play-btn:active {
  transform: scale(0.92);
}

.audio-progress-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.audio-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}

.audio-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-primary);
  transition: width 0.1s linear;
}

.audio-time-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Tab Switcher */
.tab-switcher {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  margin: 8px 20px;
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(17, 44, 78, 0.08);
}

/* Content Area */
.detail-content-wrap {
  padding: 0 20px;
  overflow-y: auto;
  max-height: 42vh;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.content-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.content-textarea:focus {
  border-color: var(--border-focus);
}

.content-textarea.raw-text {
  color: var(--text-secondary);
  font-style: italic;
  opacity: 0.9;
}

/* Compare view styles */
.compare-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.compare-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.compare-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.small-btn {
  font-size: 0.75rem;
  padding: 2px 6px;
}

/* Action items list */
.actions-section {
  padding: 12px 20px 0;
}

.section-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.actions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.actions-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.actions-list li::before {
  content: "✔";
  color: var(--accent-success);
  font-weight: bold;
}

/* Tags Section */
.tags-section {
  padding: 12px 20px;
}

.tags-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Modal Footer */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
}

/* ==========================================================================
   SETTINGS MODAL SPECIFICS
   ========================================================================== */
.settings-body {
  padding: 20px;
  overflow-y: auto;
  max-height: 65vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.label-with-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.link-hint {
  font-size: 0.8rem;
  color: var(--accent-ai);
  text-decoration: none;
}

.link-hint:hover {
  text-decoration: underline;
}

/* Radio Cards */
.provider-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.provider-option {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.provider-option.active {
  border-color: var(--accent-primary);
  background: rgba(145, 93, 47, 0.08);
}

.provider-option input[type="radio"] {
  accent-color: var(--accent-primary);
}

.provider-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.provider-sub {
  font-size: 0.725rem;
  color: var(--text-muted);
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.toggle-pwd-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
}

.setting-input, .setting-select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.setting-input:focus, .setting-select:focus {
  border-color: var(--border-focus);
}

.checkbox-group {
  margin-top: 4px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
}

.security-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 0.775rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */
.primary-btn {
  background: var(--accent-primary);
  color: white;
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.primary-btn:hover {
  background: var(--accent-primary-hover);
}

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

.primary-btn.full-width {
  width: 100%;
  padding: 14px;
}

.secondary-btn {
  background: var(--btn-icon-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
}

.secondary-btn:hover {
  background: var(--btn-icon-hover);
}

.primary-pill-btn {
  background: linear-gradient(135deg, var(--brand-terracotta), var(--brand-terracotta-dark));
  color: white;
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(145, 93, 47, 0.35);
  transition: transform 0.15s;
}

.primary-pill-btn:active {
  transform: scale(0.96);
}

.primary-pill-btn.small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.text-btn {
  background: none;
  border: none;
  color: var(--accent-ai);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}

.text-btn:hover {
  text-decoration: underline;
}

/* Toast Message */
.toast {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-navy);
  border: 1px solid var(--border-color);
  color: var(--brand-white);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(17, 44, 78, 0.25);
  z-index: 200;
  pointer-events: none;
  animation: toastIn 0.25s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Install PWA banner */
.install-banner {
  position: fixed;
  bottom: calc(16px + var(--safe-bottom));
  left: 16px;
  right: 16px;
  max-width: 608px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-modal);
  z-index: 90;
  animation: slideUp 0.3s ease-out;
}

.install-text {
  display: flex;
  flex-direction: column;
}

.install-text strong {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.install-text span {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.install-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Utilities */
.hidden {
  display: none !important;
}
