:root {
  --bg: #0f0f1a;
  --bg-secondary: #141425;
  --card: #1a1a2e;
  --card-hover: #22223a;
  --accent: #4361ee;
  --accent-hover: #3651de;
  --text: #e0e0e0;
  --text-secondary: #888;
  --success: #2ec4b6;
  --error: #e71d36;
  --warning: #ff9f1c;
  --border: #2a2a40;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.header-logo {
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
  text-decoration: none;
}

/* Main content */
.app-main {
  flex: 1;
  padding: 20px;
  position: relative;
}

/* Screen enter animation */
.screen-enter {
  animation: screenEnter 0.25s ease-out;
}

@keyframes screenEnter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s;
  line-height: 1.2;
}

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

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
}

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

.btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  width: 100%;
}

.btn-danger {
  background: transparent;
  color: var(--error);
  border: 1px solid var(--error);
  width: 100%;
}

.btn-text {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  padding: 8px;
  min-height: auto;
}

.btn-logout {
  color: var(--text-secondary);
  font-size: 14px;
}

/* FAB */
.fab {
  position: fixed;
  bottom: 24px;
  right: calc(50% - 280px);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(67, 97, 238, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  z-index: 5;
}

.fab:hover { transform: scale(1.08); }

@media (max-width: 640px) {
  .fab { right: 20px; }
}

/* Record button */
.btn-round {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s;
  color: #fff;
  line-height: 1.2;
  padding: 0;
}

.btn-record { background: var(--error); }

.recording-pulse { animation: recordPulse 1.2s ease-in-out infinite; }

@keyframes recordPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231, 29, 54, 0.5); }
  50% { box-shadow: 0 0 0 16px rgba(231, 29, 54, 0); }
}

/* Spinner */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

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

/* Forms */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}

input[type="text"],
input[type="password"],
input[type="file"],
textarea,
select {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
}

input[type="file"] {
  padding: 10px;
  font-size: 14px;
}

textarea { resize: vertical; }

/* Error */
.error-msg {
  color: var(--error);
  font-size: 14px;
  padding: 10px 14px;
  background: rgba(231, 29, 54, 0.1);
  border-radius: var(--radius-sm);
  text-align: center;
}

.hidden { display: none !important; }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--card);
  color: var(--text-secondary);
}

.badge.score {
  background: rgba(46, 196, 182, 0.15);
  color: var(--success);
}

/* Auth screen */
.auth-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 40px;
  gap: 16px;
}

.auth-logo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-title {
  font-size: 24px;
  color: var(--text);
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

/* Card list */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-item {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.card-item:hover {
  background: var(--card-hover);
  border-color: var(--accent);
}

.card-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.card-item-header h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.card-item-meta {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 14px;
}

.empty-state .btn { width: auto; }

/* Screen title */
.screen-title {
  font-size: 22px;
  margin-bottom: 20px;
}

.section-title {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 24px 0 12px;
}

/* Card detail */
.card-meta-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--card);
  border-radius: var(--radius-sm);
}

.meta-label {
  color: var(--text-secondary);
  font-size: 14px;
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lang-selector {
  display: flex;
  gap: 8px;
}

.lang-option {
  cursor: pointer;
}

.lang-option input { display: none; }

.lang-chip {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 14px;
  transition: all 0.2s;
}

.lang-option input:checked + .lang-chip {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* Interview list */
.interview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.interview-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--card);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.interview-item:hover { background: var(--card-hover); }

/* Interview screen */
.interview-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 24px;
  text-align: center;
}

.interview-status {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.subtitle-area {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 100%;
  line-height: 1.5;
  min-height: 40px;
  max-height: 200px;
  overflow-y: auto;
  padding: 0 10px;
}

.interview-controls {
  margin-top: 16px;
}

/* Report screen */
.report-screen {
  padding-bottom: 40px;
}

.score-circle {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 24px;
  padding: 20px;
}

.score-value {
  font-size: 56px;
  font-weight: 700;
  color: var(--success);
}

.score-label {
  font-size: 20px;
  color: var(--text-secondary);
}

.report-content {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  line-height: 1.6;
}

.report-content h2 {
  font-size: 18px;
  margin: 20px 0 10px;
  color: var(--accent);
}

.report-content h2:first-child { margin-top: 0; }

.report-content h3 {
  font-size: 16px;
  margin: 16px 0 8px;
}

.report-content h4 {
  font-size: 14px;
  margin: 12px 0 6px;
  color: var(--text-secondary);
}

.report-content p { margin-bottom: 10px; }

.report-content ul, .report-content ol {
  padding-left: 20px;
  margin-bottom: 10px;
}

.report-content li { margin-bottom: 4px; }

.report-content strong { color: var(--text); }

.report-content code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
}

.report-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}
