/* ───────── Reset & Base ───────── */

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

:root {
  --color-bg: #0a0c14;
  --color-surface: rgba(18, 21, 32, 0.92);
  --color-surface-hover: #222633;
  --color-border: #2a2e3d;
  --color-border-active: #4f8cff;
  --color-primary: #4f8cff;
  --color-primary-hover: #3a74e8;
  --color-primary-glow: rgba(79, 140, 255, 0.25);
  --color-text: #e8eaed;
  --color-text-muted: #8b8fa3;
  --color-success: #34d399;
  --color-success-bg: rgba(52, 211, 153, 0.1);
  --color-error: #f87171;
  --color-error-bg: rgba(248, 113, 113, 0.1);
  --color-warning: #fbbf24;
  --color-accent: #00c9a7;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

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

/* ───────── Background Image ───────── */

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    url('bg-moana.svg') center/cover no-repeat,
    linear-gradient(135deg, #0a1628 0%, #0d2137 30%, #0a2a3f 60%, #061a2e 100%);
  opacity: 0.35;
}

/* Decorative gradient fallback when no image is present */
.bg-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(0, 201, 167, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(79, 140, 255, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(124, 58, 237, 0.08) 0%, transparent 60%);
}

/* ───────── Layout ───────── */

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 540px;
  padding: 24px;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px 28px;
  backdrop-filter: blur(16px);
}

/* ───────── Language Switch ───────── */

.lang-switch {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: 12px;
}

.lang-btn {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.lang-btn:hover {
  border-color: var(--color-text-muted);
  color: var(--color-text);
}

.lang-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* ───────── Hero Header ───────── */

.hero-header {
  text-align: center;
  margin-bottom: 24px;
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 8px;
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ───────── Email Field ───────── */

.email-field {
  margin-bottom: 20px;
}

.email-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.email-field .required {
  color: var(--color-error);
}

.email-field input {
  width: 100%;
  padding: 10px 14px;
  background: var(--color-surface-hover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}

.email-field input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.6;
}

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

.email-field input.invalid {
  border-color: var(--color-error);
}

/* ───────── Drop Zone ───────── */

.drop-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--color-border-active);
  background: rgba(79, 140, 255, 0.04);
}

.drop-icon {
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.drop-text {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.drop-hint {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  margin-top: 12px;
  opacity: 0.7;
}

/* ───────── Buttons ───────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  cursor: pointer;
  transition: background var(--transition), transform 0.1s ease, box-shadow var(--transition);
}

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

.btn-select {
  background: var(--color-surface-hover);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}

.btn-select:hover {
  background: var(--color-border);
}

.btn-upload {
  width: 100%;
  background: var(--color-primary);
  color: #fff;
  font-size: 1rem;
  padding: 14px 24px;
  margin-top: 24px;
}

.btn-upload:hover:not(:disabled) {
  background: var(--color-primary-hover);
  box-shadow: 0 0 20px var(--color-primary-glow);
}

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

.btn-reset {
  width: 100%;
  background: transparent;
  color: var(--color-primary);
  font-size: 1rem;
  padding: 14px 24px;
  margin-top: 12px;
  border: 1px solid var(--color-primary);
}

.btn-reset:hover {
  background: rgba(79, 140, 255, 0.08);
}

/* ───────── File Info ───────── */

.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface-hover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 16px;
}

.file-details {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text-muted);
  min-width: 0;
}

.file-details div {
  min-width: 0;
}

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

.file-size {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.btn-remove {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}

.btn-remove:hover {
  color: var(--color-error);
  background: var(--color-error-bg);
}

/* ───────── Disclaimer ───────── */

.disclaimer {
  margin-top: 20px;
  padding: 14px 16px;
  background: rgba(79, 140, 255, 0.04);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.disclaimer-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.disclaimer-label input[type="checkbox"] {
  display: none;
}

.checkmark {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border);
  border-radius: 4px;
  margin-top: 1px;
  transition: all var(--transition);
  position: relative;
}

.disclaimer-label input[type="checkbox"]:checked + .checkmark {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.disclaimer-label input[type="checkbox"]:checked + .checkmark::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.disclaimer-text {
  flex: 1;
}

/* ───────── Progress Bar ───────── */

.progress-container {
  margin-top: 20px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--color-surface-hover);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-primary));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-text {
  text-align: right;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

/* ───────── Status Messages ───────── */

.status {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

.status.status-info {
  background: rgba(79, 140, 255, 0.08);
  color: var(--color-primary);
  border: 1px solid rgba(79, 140, 255, 0.2);
}

.status.status-success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.status.status-error {
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

/* ───────── Footer ───────── */

.footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  opacity: 0.6;
}

/* ───────── Utilities ───────── */

.hidden {
  display: none !important;
}

/* ───────── Animations ───────── */

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.uploading .drop-zone {
  pointer-events: none;
  opacity: 0.5;
}

/* ───────── Responsive ───────── */

@media (max-width: 560px) {
  .container {
    padding: 16px;
  }

  .card {
    padding: 24px 18px;
  }

  .drop-zone {
    padding: 28px 16px;
  }

  .hero-title {
    font-size: 1.6rem;
  }
}
