/* Toast */
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(20,20,36,0.95);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  pointer-events: all;
  cursor: pointer;
  min-width: 280px;
  max-width: 380px;
  animation: toastSlideIn 0.35s var(--ease-spring) forwards;
  will-change: transform, opacity;
}

.toast.leaving {
  animation: toastSlideOut 0.3s var(--ease-out-expo) forwards;
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-success .toast-icon { color: var(--accent-green); }
.toast-error .toast-icon { color: var(--accent-red); }
.toast-warning .toast-icon { color: var(--accent-orange); }
.toast-info .toast-icon { color: var(--accent-blue); }

.toast-success { border-color: rgba(52,199,89,0.25); }
.toast-error { border-color: rgba(255,69,58,0.25); }
.toast-warning { border-color: rgba(255,159,10,0.25); }
.toast-info { border-color: rgba(64,150,255,0.25); }

.toast-message {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  flex: 1;
}

.toast-close {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s ease;
  background: none;
  border: none;
}

.toast-close:hover { color: var(--text-primary); }

/* Progress bar */
.progress-bar-wrapper {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-pill);
  overflow: visible;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, rgba(64,150,255,0.9), rgba(100,80,255,0.9));
  transition: width 0.3s var(--ease-out-expo);
  position: relative;
  will-change: width;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(100,180,255,1);
  box-shadow: 0 0 8px rgba(100,180,255,0.8), 0 0 16px rgba(100,180,255,0.4);
  animation: progressGlow 1.5s ease-in-out infinite;
}

/* Checkbox */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--glass-border);
  border-radius: 5px;
  background: var(--glass-bg);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.checkbox-wrapper input[type="checkbox"]:checked {
  background: linear-gradient(135deg, rgba(64,150,255,0.9), rgba(100,80,255,0.9));
  border-color: rgba(64,150,255,0.5);
}

.checkbox-wrapper input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 2px;
  width: 6px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

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

/* Toggle switch */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.3s var(--ease-spring);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--text-tertiary);
  border-radius: 50%;
  transition: all 0.3s var(--ease-spring);
  will-change: transform;
}

.toggle-switch input:checked + .toggle-slider {
  background: rgba(64,150,255,0.3);
  border-color: rgba(64,150,255,0.5);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: var(--accent-blue);
  box-shadow: 0 0 8px rgba(64,150,255,0.5);
}

.toggle-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Range slider */
.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-pill);
  outline: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(64,150,255,0.9), rgba(100,80,255,0.9));
  cursor: pointer;
  box-shadow: 0 0 8px rgba(64,150,255,0.4);
  transition: transform 0.2s var(--ease-spring);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(64,150,255,0.9), rgba(100,80,255,0.9));
  cursor: pointer;
  border: none;
}

/* Accordion */
.accordion-item {
  border-bottom: 1px solid var(--glass-border);
}

.accordion-item:last-child { border-bottom: none; }

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.accordion-header:hover { color: var(--text-primary); }

.accordion-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.accordion-header:hover .accordion-title { color: var(--text-primary); }
.accordion-header.open .accordion-title { color: var(--text-primary); }

.accordion-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: transform 0.3s var(--ease-out-expo);
}

.accordion-header.open .accordion-icon { transform: rotate(180deg); }

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease-out-expo);
}

.accordion-body.open {
  max-height: 200px;
}

.accordion-content {
  padding-bottom: 18px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Tabs */
.tabs-wrapper {
  display: flex;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 2px;
}

.tab-btn {
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
  background: none;
  border: none;
  font-family: var(--font-family);
  white-space: nowrap;
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(64,150,255,0.25) 0%, rgba(100,80,255,0.25) 100%);
  color: var(--text-primary);
  border: 1px solid rgba(64,150,255,0.2);
  box-shadow: 0 2px 8px rgba(64,150,255,0.15);
}

/* Or divider */
.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.or-divider-line {
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

.or-divider-text {
  font-size: 0.8125rem;
  color: var(--text-quaternary);
  white-space: nowrap;
}

/* Google button */
.btn-google {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  width: 100%;
  font-family: var(--font-family);
}

.btn-google:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* Eye toggle for password */
.input-eye-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: none;
  background: none;
  transition: color 0.2s ease;
}

.input-eye-toggle:hover { color: var(--text-secondary); }

.input-field.has-icon-right {
  padding-right: 44px;
}

/* Password strength */
.password-strength {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.strength-bars {
  display: flex;
  gap: 4px;
}

.strength-bar {
  flex: 1;
  height: 3px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.08);
  transition: all 0.3s ease;
}

.strength-bar.active-weak { background: var(--accent-red); }
.strength-bar.active-fair { background: var(--accent-orange); }
.strength-bar.active-good { background: var(--accent-blue); }
.strength-bar.active-strong { background: var(--accent-green); }

.strength-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  transition: color 0.3s ease;
}

/* Stat card */
.stat-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.stat-icon-blue { background: rgba(64,150,255,0.15); color: var(--accent-blue); }
.stat-icon-green { background: rgba(52,199,89,0.15); color: var(--accent-green); }
.stat-icon-purple { background: rgba(150,80,255,0.15); color: var(--accent-purple); }
.stat-icon-orange { background: rgba(255,159,10,0.15); color: var(--accent-orange); }

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1;
}

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

/* Feature card */
.feature-card {
  padding: 28px;
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.feature-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Grid layouts */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* Step indicator */
.step-number {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(64,150,255,0.2), rgba(100,80,255,0.2));
  border: 1px solid rgba(64,150,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-blue);
  flex-shrink: 0;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 12px;
  text-align: center;
}

.empty-state-icon {
  font-size: 3rem;
  opacity: 0.4;
  margin-bottom: 8px;
}

.empty-state-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-state-desc {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  max-width: 280px;
}

/* CTA section animated border */
.cta-section-inner {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 64px 48px;
  text-align: center;
  background: var(--glass-bg);
  overflow: hidden;
}

.cta-section-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(64,150,255,0.4), rgba(100,80,255,0.4), rgba(52,199,89,0.3), rgba(64,150,255,0.4));
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: borderGlow 4s ease infinite, gradientShift 6s ease infinite;
  pointer-events: none;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* History item */
.history-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  transition: all 0.2s ease;
}

.history-item:hover {
  border-color: var(--glass-border-hover);
  background: var(--glass-bg-hover);
}

.history-thumb {
  width: 56px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}

.history-thumb img, .history-thumb canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-info { flex: 1; min-width: 0; }

.history-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.history-status {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ── Language Switcher ── */
.nav-lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-pill);
  padding: 4px;
}

.lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 26px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
  opacity: 0.45;
  padding: 0;
  overflow: hidden;
}

.lang-btn:hover { opacity: 0.8; }
.lang-btn.active {
  background: rgba(255,255,255,0.1);
  opacity: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.lang-btn svg {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  display: block;
}

/* ── Icon sizes ── */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon--sm  { width: 16px; height: 16px; }
.icon      { width: 20px; height: 20px; }
.icon--lg  { width: 24px; height: 24px; }
.icon--xl  { width: 32px; height: 32px; }
.icon svg  { width: 100%; height: 100%; }

.history-status-done {
  background: rgba(52,199,89,0.12);
  color: var(--accent-green);
  border: 1px solid rgba(52,199,89,0.2);
}
