/* ==========================================================================
   Project 4000+ (Mitsui & Co. Perú) - Mobile First Design System & UI Styles
   ========================================================================== */

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

:root {
  /* Brand Palette */
  --color-blue: #0072CE;
  --color-blue-dark: #00569E;
  --color-green: #78BE20;
  --color-orange: #F6A01A;
  --color-red: #E43A26;
  --color-navy: #1D2B6C;

  /* UI Gradients */
  --grad-primary: linear-gradient(135deg, #0072CE 0%, #1D2B6C 100%);
  --grad-accent: linear-gradient(135deg, #78BE20 0%, #0072CE 100%);
  --grad-warning: linear-gradient(135deg, #F6A01A 0%, #E43A26 100%);
  --grad-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);

  /* Neutral Shades */
  --bg-main: #F4F7FB;
  --surface: #FFFFFF;
  --surface-hover: #F8FAFC;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --border-light: #E2E8F0;
  --border-focus: #0072CE;

  /* Shadows & Elevation */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px -10px rgba(0, 114, 206, 0.15);

  /* Spacing & Radius */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;

  --font-heading: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
}

/* Reset & Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(0, 114, 206, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(120, 190, 32, 0.06) 0%, transparent 40%);
}

/* Background Petals Glow Effect */
.bg-decor {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  opacity: 0.7;
}

.petal-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
}
.petal-glow-1 { top: -80px; left: -80px; width: 250px; height: 250px; background: rgba(0, 114, 206, 0.15); }
.petal-glow-2 { top: 30%; right: -100px; width: 280px; height: 280px; background: rgba(120, 190, 32, 0.12); }
.petal-glow-3 { bottom: -80px; left: 20%; width: 300px; height: 300px; background: rgba(246, 160, 26, 0.12); }

/* Main App Wrapper (Mobile-First Centered Container) */
.app-container {
  max-width: 580px;
  margin: 0 auto;
  padding: 16px;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header Section */
.app-header {
  text-align: center;
  margin-bottom: 20px;
  padding-top: 10px;
}

.logo-wrapper {
  display: inline-block;
  margin-bottom: 8px;
}

.logo-img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  display: block;
  margin: 0 auto;
}

.company-badge-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  margin-top: 6px;
}

.company-badge-header .comp-icon {
  color: var(--color-blue);
  font-size: 1.1rem;
}

.company-badge-header .comp-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-navy);
  letter-spacing: 0.3px;
}

/* Step Wizard Progress Bar */
.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  position: relative;
  padding: 0 10px;
}

.wizard-progress::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 35px;
  right: 35px;
  height: 3px;
  background: var(--border-light);
  z-index: 0;
}

.wizard-progress-bar {
  position: absolute;
  top: 18px;
  left: 35px;
  height: 3px;
  background: var(--grad-primary);
  z-index: 0;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-light);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.step-item.active .step-circle {
  background: var(--color-blue);
  border-color: var(--color-blue);
  color: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(0, 114, 206, 0.2);
}

.step-item.completed .step-circle {
  background: var(--color-green);
  border-color: var(--color-green);
  color: #FFFFFF;
}

.step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.step-item.active .step-label {
  color: var(--color-blue);
  font-weight: 700;
}

/* Glass Card Component */
.glass-card {
  background: var(--grad-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px 20px;
  margin-bottom: 24px;
  transition: all 0.3s ease;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title i {
  color: var(--color-blue);
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.4;
}

/* Date Selector Grid */
.date-selector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.date-card {
  background: var(--surface);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.date-card:hover {
  border-color: var(--color-blue);
  background: var(--surface-hover);
}

.date-card.selected {
  border-color: var(--color-blue);
  background: rgba(0, 114, 206, 0.04);
  box-shadow: 0 4px 12px rgba(0, 114, 206, 0.15);
}

.date-card.selected::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 10px;
  font-weight: 900;
  color: var(--color-blue);
  font-size: 0.85rem;
}

.date-icon {
  font-size: 1.4rem;
  color: var(--color-blue);
  margin-bottom: 4px;
}

.date-day {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-main);
}

.date-month {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

/* Task / Event List Cards */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.task-card {
  background: var(--surface);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.task-card:hover:not(.disabled) {
  border-color: var(--color-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.task-card.selected {
  border-color: var(--color-blue);
  background: rgba(0, 114, 206, 0.03);
  box-shadow: 0 6px 16px rgba(0, 114, 206, 0.12);
}

.task-card.disabled {
  opacity: 0.6;
  background: #F8FAFC;
  cursor: not-allowed;
  border-color: #E2E8F0;
}

.task-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.task-info-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(0, 114, 206, 0.1);
  color: var(--color-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.task-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
  line-height: 1.3;
}

.task-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Quota Badges */
.quota-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-available {
  background: rgba(120, 190, 32, 0.15);
  color: #4B7D0D;
  border: 1px solid rgba(120, 190, 32, 0.3);
}

.badge-low {
  background: rgba(246, 160, 26, 0.15);
  color: #B46B00;
  border: 1px solid rgba(246, 160, 26, 0.3);
}

.badge-full {
  background: rgba(228, 58, 38, 0.12);
  color: #D32F2F;
  border: 1px solid rgba(228, 58, 38, 0.25);
}

/* Form Group Controls */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-label .required {
  color: var(--color-red);
}

.form-control {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-main);
  background: var(--surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  outline: none;
}

.form-control:focus {
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3.5px rgba(0, 114, 206, 0.15);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748B' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* Input Icon Wrapper */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-wrapper i {
  position: absolute;
  left: 14px;
  color: var(--color-blue);
  font-size: 1.1rem;
  pointer-events: none;
  transition: color 0.2s ease;
  z-index: 2;
}

.input-wrapper .form-control {
  padding-left: 44px;
}

.input-wrapper:focus-within i {
  color: var(--color-navy);
}

/* Button UI */
.btn-primary {
  width: 100%;
  height: 52px;
  background: var(--grad-primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-lg);
  margin-top: 10px;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 114, 206, 0.3);
}

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

.btn-secondary {
  width: 100%;
  height: 48px;
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-main);
}

/* Ticket Design Component */
.ticket-container {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  position: relative;
}

.ticket-header {
  background: var(--grad-primary);
  color: #FFFFFF;
  padding: 24px 20px;
  text-align: center;
  position: relative;
}

.ticket-header-logo {
  width: 85px;
  height: 85px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 10px auto;
  background: #FFFFFF;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  display: block;
}

.ticket-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(120, 190, 32, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #FFFFFF;
  padding: 4px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
}

.ticket-body {
  padding: 24px 20px;
}

.ticket-code-box {
  background: #F8FAFC;
  border: 2px dashed var(--color-blue);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  margin-bottom: 20px;
}

.ticket-code-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 1px;
}

.ticket-code-val {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.6rem;
  color: var(--color-blue);
  letter-spacing: 2px;
}

.ticket-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-item.full-width {
  grid-column: span 2;
}

.info-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.info-value {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.ticket-qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: #F8FAFC;
  border-radius: var(--radius-md);
}

/* Restricted Access Error Card */
.restricted-card {
  text-align: center;
  padding: 40px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto 0;
}

.restricted-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(228, 58, 38, 0.1);
  color: var(--color-red);
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  flex-shrink: 0;
}

.restricted-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text-main);
  margin-bottom: 12px;
  text-align: center;
}

.restricted-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0;
  text-align: center;
  max-width: 440px;
}

/* Footer Section */
.app-footer {
  margin-top: auto;
  text-align: center;
  padding: 20px 0 10px 0;
  font-size: 0.8rem;
  color: var(--text-light);
}

.app-footer a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
}

/* Responsive adjustments */
@media (min-width: 640px) {
  .app-container {
    padding: 32px 20px;
  }
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .form-group.full-width {
    grid-column: span 2;
  }
}
