/* ============================================================
   STYLES — Account Deletion Portal
   Design tokens are injected at runtime from config.js
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Design Tokens (overridden by JS from config.js) ── */
:root {
  --color-primary:        #6C63FF;
  --color-primary-hover:  #574fd6;
  --color-danger:         #FF4D6D;
  --color-danger-hover:   #e0354f;
  --color-bg:             #0f0f13;
  --color-surface:        #1a1a24;
  --color-border:         #2e2e42;
  --color-text-primary:   #f0f0f5;
  --color-text-secondary: #8888aa;
  --color-input-bg:       #13131c;

  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --radius-full: 9999px;

  --transition: 0.2s ease;
}

/* ── Base ── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-x: hidden;
}

/* ── Background gradient ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(16,185,129,0.15) 0%, transparent 60%),
    radial-gradient(circle at bottom right, rgba(16,185,129,0.1) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  animation: bg-breathe 8s ease-in-out infinite alternate;
}

@keyframes bg-breathe {
  0%   { opacity: 0.6; transform: scale(1); }
  100% { opacity: 1;   transform: scale(1.03); }
}


/* ── App Shell ── */
#app {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

/* ── View switching ── */
.view {
  display: none;
  animation: fadeSlideIn 0.35s ease forwards;
}
.view.active { display: block; }

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

/* ── Card ── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  position: relative;
  overflow: hidden;
}

/* Subtle top highlight line */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(16,185,129,0.45), transparent);
}

/* ── Logo / Brand header ── */
.brand-header {
  text-align: center;
  margin-bottom: 32px;
}

.brand-logo-img {
  display: block;
  margin: 0 auto 12px auto;
  height: 84px;
  object-fit: contain;
}

.brand-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #10b981, #065f46);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(16,185,129,0.3);
}

.brand-icon svg { width: 26px; height: 26px; color: #fff; }

.brand-name {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-tagline {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

/* ── Section title inside card ── */
.section-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* ── Form ── */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  background: var(--color-input-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 12px 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.18);
}

input::placeholder { color: var(--color-text-secondary); }

/* Password wrapper with show/hide toggle */
.input-wrapper {
  position: relative;
}

.input-wrapper input { padding-right: 44px; }

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}

.toggle-password:hover { color: var(--color-text-primary); }
.toggle-password svg { width: 18px; height: 18px; }

/* ── Error message ── */
.error-msg {
  background: rgba(255,77,109,0.12);
  border: 1px solid rgba(255,77,109,0.3);
  border-radius: var(--radius-sm);
  color: #ff7d95;
  font-size: 0.83rem;
  padding: 10px 14px;
  margin-bottom: 16px;
  display: none;
}
.error-msg.visible { display: block; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 13px 20px;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

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

/* Primary button */
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 20px rgba(16,185,129,0.35);
}

/* Danger button */
.btn-danger {
  background: var(--color-danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  background: var(--color-danger-hover);
  box-shadow: 0 4px 20px rgba(255,77,109,0.4);
}

/* Ghost button */
.btn-ghost {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--color-text-secondary);
  color: var(--color-text-primary);
}

/* Google button */
.btn-google {
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #d0d0d0;
}
.btn-google:hover:not(:disabled) {
  background: #f5f5f5;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

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

/* ── Spinner inside button ── */
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn-google .btn-spinner {
  border-color: rgba(0,0,0,0.15);
  border-top-color: #333;
}

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

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--color-text-secondary);
  font-size: 0.78rem;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* ── Confirmation box (deletion view) ── */
.confirm-box {
  background: rgba(255,77,109,0.07);
  border: 1px solid rgba(255,77,109,0.22);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 24px;
}

.confirm-box-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ff7d95;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.confirm-box-body {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
}

/* ── User info chip ── */
.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-input-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 8px 16px 8px 8px;
  margin-bottom: 24px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #065f46);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-info { overflow: hidden; }

.user-name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Success view ── */
.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(72,199,142,0.15);
  border: 2px solid rgba(72,199,142,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

.success-icon svg { width: 30px; height: 30px; color: #48c78e; }

@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.success-title {
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.success-body {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-align: center;
  line-height: 1.6;
}

/* ── Progress bar (success screen countdown) ── */
.progress-bar-wrap {
  height: 3px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  margin-top: 28px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  width: 100%;
  transform-origin: left;
  animation: shrink var(--success-duration, 3s) linear forwards;
}

@keyframes shrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ── Full-screen overlay loader ── */
#overlay-loader {
  position: fixed;
  inset: 0;
  background: rgba(15,15,19,0.85);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  flex-direction: column;
  gap: 16px;
}

#overlay-loader.visible { display: flex; }

.overlay-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(16,185,129,0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.overlay-label {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .card { padding: 28px 20px; }
  body  { padding: 16px; }
}

/* ── Step indicator ── */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 22px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-input-bg);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  transition: background var(--transition), border-color var(--transition);
}

.step.active .step-dot {
  background: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(16,185,129,0.2);
}

.step.done .step-dot {
  background: #48c78e;
  border-color: #48c78e;
  color: #fff;
}

.step-label {
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.step.active .step-label { color: var(--color-primary); font-weight: 600; }
.step.done  .step-label  { color: #48c78e; }

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--color-border);
  margin: 0 6px;
  margin-bottom: 20px; /* align with dot centres */
  transition: background var(--transition);
}
.step-connector.filled { background: #48c78e; }

/* ── Confirm box bullet list ── */
.confirm-box-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.confirm-box-list li {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  line-height: 1.45;
  padding-left: 16px;
  position: relative;
}

.confirm-box-list li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: #ff7d95;
  font-size: 1.1rem;
  line-height: 1.2;
}

/* ── DELETE keyword highlight ── */
.keyword-hint {
  color: #ff7d95;
  font-family: 'Courier New', monospace;
  font-size: 0.95em;
  letter-spacing: 0.06em;
  background: rgba(255,77,109,0.1);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ── Confirm text input (type-to-confirm) ── */
.confirm-text-input {
  font-family: 'Courier New', monospace;
  letter-spacing: 0.12em;
  font-size: 1rem;
  text-align: center;
}

.confirm-text-input:focus {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(255,77,109,0.18);
}

