:root {
  --primary: #0050a0;
  --border-light: rgba(0, 80, 160, 0.3);
  --border-onboarding: rgba(0, 80, 160, 0.24);
  --input-bg: rgba(255, 255, 255, 0.5);
  --input-bg-onboarding: rgba(255, 255, 255, 0.72);
  --text-muted: rgba(0, 0, 0, 0.5);
  --text-muted-2: #8f9098;
  --separator: #e7e7e7;
  --separator-text: #6c737f;
  --error: #b91c1c;
  --error-verify: #b00020;
  --bg-onboarding: #f6f8fc;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

input,
textarea,
select {
  font-size: 16px !important;
}

.screen {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  background: #fff;
  overflow: hidden;
}

.screen-pad {
  position: relative;
  z-index: 1;
  padding: 0 25px 40px;
  min-height: 100vh;
  min-height: 100dvh;
}

.bg-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-lines svg {
  width: 100%;
  height: 100%;
  display: block;
}

.scroll {
  position: relative;
  z-index: 1;
  padding: 48px 0;
  max-width: 480px;
  margin: 0 auto;
  min-height: max(400px, calc(100vh - 220px));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.title {
  margin: 0 0 20px;
  font-size: 24px;
  font-weight: 500;
  line-height: 30px;
  color: var(--primary);
  text-align: center;
}

.subtitle {
  margin: 0 0 24px;
  font-size: 12px;
  line-height: 20px;
  color: var(--text-muted);
  text-align: center;
}

.field-label {
  display: block;
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  color: var(--primary);
}

.input {
  display: block;
  width: 100%;
  height: 48px;
  margin: 0 0 16px;
  padding: 0 16px;
  background: var(--input-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  font-size: 14px;
  line-height: 20px;
  color: #000;
  outline: none;
}

.input:focus {
  border-color: var(--primary);
}

.password-row {
  position: relative;
  margin-bottom: 16px;
}

.password-row .input {
  margin-bottom: 0;
  padding-right: 120px;
}

.password-row.with-eye .input {
  padding-right: 48px;
}

.forgot-link {
  position: absolute;
  right: 16px;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  border: 0;
  background: none;
  padding: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--primary);
  cursor: pointer;
}

.eye-btn {
  position: absolute;
  right: 12px;
  top: 0;
  bottom: 0;
  width: 36px;
  border: 0;
  background: none;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hint {
  margin: -8px 0 12px;
  font-size: 12px;
  line-height: 16px;
  color: var(--error);
}

.checklist {
  margin: 8px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.check-icon {
  width: 20px;
  height: 20px;
  border-radius: 10px;
  border: 2px solid var(--primary);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.check-icon.dim {
  border-color: var(--border-light);
  background: rgba(255, 255, 255, 0.6);
}

.check-label {
  font-size: 12px;
  line-height: 16px;
  color: var(--text-muted);
}

.check-label a {
  color: var(--primary);
  text-decoration: underline;
}

.error {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--error);
}

.info {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--primary);
}

.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 55px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn .spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.link-row {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  line-height: 20px;
  color: var(--text-muted);
}

.link-row a,
.link-row button.linkish {
  color: var(--primary);
  text-decoration: underline;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.separator {
  display: flex;
  align-items: center;
  margin: 32px 0 24px;
  gap: 12px;
}

.separator::before,
.separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--separator);
}

.separator span {
  font-size: 12px;
  line-height: 15px;
  color: var(--separator-text);
}

.social-row {
  display: flex;
  justify-content: center;
}

.social-btn {
  width: 45px;
  height: 45px;
  border-radius: 5px;
  border: 1px solid var(--border-light);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

/* Register: Google first — full-width, tall, with label (character.ai-style). */
.social-btn-big {
  width: 100%;
  min-height: 54px;
  margin: 6px 0 4px;
  border-radius: 14px;
  border: 1px solid var(--border-light);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  padding: 0 16px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}
.social-btn-big svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.social-btn-big:active {
  transform: scale(0.99);
}

.select {
  width: 100%;
  height: 48px;
  margin: 0 0 16px;
  padding: 0 40px 0 16px;
  background-color: var(--input-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  font-size: 14px;
  color: #000;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230050A0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.verify-content {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 80px 24px 48px;
}

.verify-content .title {
  margin-bottom: 12px;
}

.verify-content .subtitle {
  font-size: 14px;
  margin-bottom: 32px;
}

.verify-content .email-hl {
  color: var(--primary);
  font-weight: 600;
}

.code-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
  cursor: text;
}

.code-box {
  width: 48px;
  height: 56px;
  border-radius: 12px;
  border: 1px solid rgba(0, 80, 160, 0.35);
  background: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  color: var(--primary);
}

.hidden-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.verify-content .error {
  color: var(--error-verify);
}

.resend {
  display: block;
  margin: 20px auto 0;
  border: 0;
  background: none;
  color: var(--primary);
  text-decoration: underline;
  font-size: 12px;
  cursor: pointer;
}

.onb-screen {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-onboarding);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
}

.onb-frame {
  width: min(520px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  background: #fff;
  border: 1px solid var(--border-onboarding);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(0, 80, 160, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.onb-top {
  padding: 20px 20px 12px;
}

.onb-step {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.onb-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 80, 160, 0.12);
  overflow: hidden;
}

.onb-progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.2s ease;
}

.onb-body {
  padding: 0 20px 16px;
  overflow: auto;
  flex: 1;
}

.onb-title {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
  color: var(--primary);
}

.onb-sub {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 18px;
  color: #3f4b5f;
}

.onb-input {
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  padding: 12px 14px;
  background: var(--input-bg-onboarding);
  border: 1px solid var(--border-onboarding);
  border-radius: 12px;
  font-size: 16px;
  color: #1f2024;
  outline: none;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.option-card {
  min-height: 56px;
  padding: 14px;
  border: 1px solid var(--border-onboarding);
  border-radius: 12px;
  background: var(--input-bg-onboarding);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
}

.option-card.selected {
  border-color: var(--primary);
  background: rgba(0, 80, 160, 0.08);
}

.option-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.option-icon svg {
  display: block;
}

.option-label {
  flex: 1;
  font-size: 15px;
  line-height: 20px;
  color: #1f2024;
  font-weight: 500;
}

.option-card.selected .option-label {
  color: var(--primary);
  font-weight: 700;
}

.option-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-muted-2);
  font-weight: 400;
}

.onb-footer {
  border-top: 1px solid #e5e7eb;
  padding: 12px 20px 18px;
}

.onb-actions {
  display: flex;
  gap: 10px;
}

.onb-back {
  flex: 0 0 auto;
  min-width: 88px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border-onboarding);
  background: #fff;
  color: var(--primary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.onb-next {
  flex: 1;
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.onb-footer > .onb-next {
  display: block;
  width: 100%;
}

.onb-next:disabled {
  opacity: 0.5;
  cursor: default;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.modal-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.modal-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.modal-input {
  width: 100%;
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--border-onboarding);
  border-radius: 12px;
  resize: vertical;
  font-size: 15px;
  outline: none;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.modal-actions button {
  flex: 1;
  height: 44px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.modal-cancel {
  border: 1px solid var(--border-onboarding);
  background: #fff;
  color: var(--primary);
}

.modal-confirm {
  border: 0;
  background: var(--primary);
  color: #fff;
}

.modal-confirm:disabled {
  opacity: 0.5;
}

.prep-screen {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--primary);
  overflow: hidden;
}

.loading-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.loading-frame-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.prep-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  z-index: 1;
  pointer-events: none;
}

/* Parity with LoadingCarousel.tsx */
.prep-carousel {
  width: min(520px, 100%);
  height: 168px; /* ROW_HEIGHT 56 × 3 */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.prep-carousel-viewport {
  width: 100%;
  height: 168px;
  overflow: hidden;
}

.prep-carousel-strip {
  width: 100%;
  height: 224px; /* 56 × 4 */
  will-change: transform;
}

.prep-carousel-row {
  width: 100%;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  color: #fff;
  font-weight: 600;
  font-size: 18px;
  line-height: 24.3px; /* 18 * 1.35 */
  text-align: center;
  padding: 0 8px;
  box-sizing: border-box;
}

.prep-carousel-row span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
}

.prep-error {
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
  font-size: 14px;
  text-align: center;
  max-width: 320px;
  pointer-events: auto;
}

.prep-retry {
  margin-top: 12px;
  padding: 10px 20px;
  border-radius: 12px;
  border: 0;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
}

.oauth-msg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--primary);
  font-size: 16px;
  text-align: center;
}

.center-spinner {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.center-spinner .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(0, 80, 160, 0.25);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
