/* ============================================
   DHL RECRUITMENT PORTAL — DESIGN SYSTEM v2
   ============================================
   Default: Light DHL Theme (White + Yellow/Red)
   Dark mode: opt-in via [data-theme="dark"]
   KYC screens: always white via .kyc-screen
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Public+Sans:wght@500;600;700;800;900&display=swap');

/* ── LIGHT THEME (Default) ── */
:root {
  /* DHL Brand */
  --dhl-yellow: #FFCC00;
  --dhl-yellow-dim: #E6B800;
  --dhl-red: #D40511;
  --dhl-red-dark: #B00410;

  /* Surfaces */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F5F5F7;
  --bg-tertiary: #EFEFEF;
  --bg-card: #FFFFFF;
  --bg-input: #F5F5F7;
  --bg-header: #FFFFFF;
  --bg-body: #F0F0F2;

  /* Text */
  --text-primary: #1A1A1A;
  --text-secondary: #555555;
  --text-tertiary: #888888;
  --text-inverse: #1A1A1A;
  --text-on-red: #FFFFFF;
  --text-on-yellow: #1A1A1A;

  /* Borders */
  --border-light: #E0E0E0;
  --border-medium: #D0D0D0;
  --border-input: #CCCCCC;
  --border-focus: var(--dhl-yellow);

  /* Status */
  --success: #16A34A;
  --success-bg: rgba(22, 163, 74, 0.08);
  --error: #DC2626;
  --warning: #F59E0B;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
  --shadow-btn: 0 4px 14px rgba(212, 5, 17, 0.35);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-glow-yellow: 0 0 20px rgba(255,204,0,0.25);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Layout */
  --mobile-max: 480px;
  --header-height: 56px;
  --footer-height: 100px;

  /* Progress */
  --progress-bg: #E0E0E0;
  --progress-fill: linear-gradient(90deg, var(--dhl-red), var(--dhl-yellow));
}

/* ── DARK THEME (Toggle) ── */
[data-theme="dark"] {
  --bg-primary: #111114;
  --bg-secondary: #18181B;
  --bg-tertiary: #1E1E22;
  --bg-card: #1E1E22;
  --bg-input: #27272B;
  --bg-header: #111114;
  --bg-body: #0A0A0B;

  --text-primary: #FAFAFA;
  --text-secondary: #A1A1AA;
  --text-tertiary: #71717A;
  --text-inverse: #1A1A1A;

  --border-light: #27272B;
  --border-medium: #333338;
  --border-input: #3F3F46;
  --border-focus: var(--dhl-yellow);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.3);

  --progress-bg: #27272B;
}

/* ── KYC SCREENS: Always White ── */
.kyc-screen {
  --bg-primary: #FFFFFF !important;
  --bg-secondary: #F5F5F7 !important;
  --bg-tertiary: #EFEFEF !important;
  --bg-card: #FFFFFF !important;
  --bg-input: #F5F5F7 !important;
  --bg-header: #FFFFFF !important;
  --bg-body: #F8F8FA !important;
  --text-primary: #1A1A1A !important;
  --text-secondary: #555555 !important;
  --text-tertiary: #888888 !important;
  --border-light: #E0E0E0 !important;
  --border-medium: #D0D0D0 !important;
  --border-input: #CCCCCC !important;
  --shadow-card: 0 2px 12px rgba(0,0,0,0.06) !important;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── MOBILE WRAPPER ── */
.mobile-wrapper {
  max-width: var(--mobile-max);
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg-primary);
  position: relative;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

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

.header-title {
  font-family: 'Public Sans', sans-serif;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.header-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.header-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ── THEME TOGGLE ── */
.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 18px;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  background: var(--dhl-yellow);
  color: var(--text-inverse);
  border-color: var(--dhl-yellow);
}

/* ── PROGRESS BAR ── */
.progress-track {
  height: 4px;
  background: var(--progress-bg);
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--progress-fill);
  border-radius: 0 2px 2px 0;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

/* ── CONTENT AREA ── */
.content-area {
  flex: 1;
  padding: 28px 20px;
  padding-bottom: calc(var(--footer-height) + 28px);
}

/* ── STEP BADGE ── */
.step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-family: 'Public Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* ── TYPOGRAPHY ── */
.text-h1 {
  font-family: 'Public Sans', sans-serif;
  font-weight: 900;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.text-h2 {
  font-family: 'Public Sans', sans-serif;
  font-weight: 800;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.text-h3 {
  font-family: 'Public Sans', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
}

.text-body-lg {
  font-size: 16px; line-height: 1.55; color: var(--text-secondary);
}
.text-body-md {
  font-size: 15px; line-height: 1.5; color: var(--text-secondary);
}
.text-body-sm {
  font-size: 13px; line-height: 1.5; color: var(--text-tertiary);
}
.text-label {
  font-family: 'Public Sans', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-tertiary);
}

/* ── BUTTONS ── */
.btn-primary {
  width: 100%;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--dhl-red);
  color: var(--text-on-red);
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Public Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: all 0.25s ease;
}

.btn-primary:hover {
  background: var(--dhl-red-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212,5,17,0.45);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary .material-symbols-outlined {
  font-size: 20px;
}

.btn-primary.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-secondary {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-family: 'Public Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: var(--dhl-red);
  color: var(--dhl-red);
  background: rgba(212,5,17,0.04);
}

/* ── FORMS ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-family: 'Public Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.form-input {
  height: 50px;
  padding: 0 16px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-input);
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: var(--text-primary);
  transition: all 0.2s;
  outline: none;
  width: 100%;
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

.form-input:focus {
  border-color: var(--dhl-yellow);
  box-shadow: 0 0 0 3px rgba(255,204,0,0.15);
  background: var(--bg-primary);
}

/* ── CARDS ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

/* ── UPLOAD ZONE ── */
.upload-zone {
  width: 100%;
  aspect-ratio: 1.586/1;
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
}

.upload-zone:hover {
  border-color: var(--dhl-yellow);
  background: rgba(255,204,0,0.03);
}

.upload-zone .icon-circle {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--dhl-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow-yellow);
  position: relative;
  z-index: 2;
}

/* ── INLINE CAMERA VIEWFINDER ── */
.camera-inline {
  position: relative;
  width: 100%;
  aspect-ratio: 1.586/1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  border: 2px solid var(--border-light);
}

.camera-inline video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-inline canvas {
  display: none;
}

.in-frame-validation {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: #000;
}

.in-frame-validation img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.in-frame-validation .validation-content {
  position: relative;
  z-index: 21;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 16px;
  background: rgba(0, 0, 0, 0.35);
}

.camera-inline .cam-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.camera-inline .cam-frame {
  position: absolute;
  inset: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: var(--radius-md);
  pointer-events: none;
  z-index: 5;
}

.camera-inline .cam-corners {
  position: absolute;
  inset: 12px;
  pointer-events: none;
  z-index: 6;
}

/* Corner brackets */
.corner { position: absolute; width: 24px; height: 24px; border-color: var(--dhl-yellow); border-style: solid; }
.corner-tl { top: 0; left: 0; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.corner-tr { top: 0; right: 0; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.corner-bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.corner-br { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }

/* Circular camera for selfie */
.camera-circle {
  position: relative;
  width: 240px;
  height: 240px;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 0 auto;
  background: #000;
  border: 3px solid var(--border-light);
  box-shadow: var(--shadow-lg);
}

.camera-circle video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.camera-circle .face-ring {
  position: absolute;
  inset: -6px;
  border-radius: var(--radius-full);
  border: 3px solid var(--dhl-yellow);
  opacity: 0.4;
  animation: ring-pulse 2s ease-out infinite;
  pointer-events: none;
}

/* ── SECURITY NOTICE ── */
.security-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--success-bg);
  border: 1px solid rgba(22,163,74,0.15);
  border-radius: var(--radius-md);
  margin-top: 20px;
}

/* ── INFO BADGE ── */
.info-badge {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(255,204,0,0.06);
  border-left: 3px solid var(--dhl-yellow);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* ── STICKY FOOTER ── */
.sticky-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--mobile-max);
  padding: 16px 20px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: var(--bg-primary);
  border-top: 1px solid var(--border-light);
  z-index: 50;
}

/* ── ANIMATIONS ── */
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ring-pulse {
  0% { transform: scale(1); opacity: 0.4; }
  70% { transform: scale(1.08); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

@keyframes float {
  0% { transform: translateX(0); }
  100% { transform: translateX(6px); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: var(--shadow-btn); }
  50% { box-shadow: 0 4px 24px rgba(212,5,17,0.5); }
}

.pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }

@keyframes confetti-fall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  .mobile-wrapper {
    max-width: 100%;
    box-shadow: none;
  }
}
