:root {
  --bg-color: #0B0F19;
  --panel-bg: #1E293B;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --primary: #3B82F6;
  --primary-hover: #2563EB;
  --danger: #EF4444;
  --success: #22C55E;
  --border-color: #334155;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.screen { display: none; width: 100%; height: 100%; flex-direction: column; }
.screen.active { display: flex; }

/* Login */
#loginScreen { justify-content: center; align-items: center; }

.login-card {
  background-color: var(--panel-bg);
  padding: 48px 40px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  text-align: center;
  max-width: 420px;
  width: 100%;
}

.login-card .logo-icon {
  margin: 0 auto 24px auto;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), #8B5CF6);
  border-radius: 14px;
}

.login-card h1 { font-size: 28px; margin-bottom: 8px; }
.login-card p { color: var(--text-muted); font-size: 15px; margin-bottom: 32px; }

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: white;
  color: #333;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: all 0.2s;
}
.btn-google:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
.btn-google:active { transform: translateY(1px); }

.terms-text { font-size: 12px; color: var(--text-muted); margin-top: 20px; }

.error-msg { color: var(--danger); font-size: 14px; margin-top: 16px; }
.error-msg.hidden { display: none; }

/* App Screen */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border-color);
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo h1 { font-size: 18px; }

.logo-icon {
  width: 24px; height: 24px;
  background: linear-gradient(135deg, var(--primary), #8B5CF6);
  border-radius: 6px;
}

.header-right { display: flex; align-items: center; gap: 12px; }

.usage-badge {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.btn-upgrade {
  background: linear-gradient(135deg, #8B5CF6, #EC4899);
  color: white;
  border: none;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-upgrade:hover { transform: translateY(-1px); }
.btn-upgrade.hidden { display: none; }

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.btn-secondary:hover { background: rgba(255,255,255,0.05); color: white; }

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.mic-container {
  position: relative;
  width: 140px; height: 140px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

.mic-btn {
  width: 90px; height: 90px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #1E293B, #0F172A);
  color: var(--text-main);
  cursor: pointer;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transition: all 0.2s ease;
}
.mic-btn svg { width: 40px; height: 40px; }
.mic-btn:hover { transform: translateY(-2px); }

.recording .mic-btn {
  background: linear-gradient(135deg, #7F1D1D, #450A0A);
  color: #FCA5A5;
}

.recording .glow-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 90px; height: 90px;
  margin-top: -45px; margin-left: -45px;
  border-radius: 50%;
  background-color: var(--danger);
  z-index: 1;
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2); opacity: 0; }
}

.status-container { margin-bottom: 40px; color: var(--text-muted); }
.recording .status-container { color: var(--danger); font-weight: 600; }

.transcript-box {
  width: 100%;
  height: 200px;
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  overflow-y: auto;
  font-size: 18px;
  line-height: 1.6;
}

.placeholder { color: var(--text-muted); font-style: italic; }
