/* ==========================================================================
   Saudav Staffing Corp - Onboarding Portal Stylesheet
   ========================================================================== */

/* Color Palette Variables */
:root {
  --blue-dark: #1450A0;
  --blue-med:  #2864B4;
  --black:     #141414;
  --white:     #FFFFFF;
  --gray:      #C8C8C8;
  --gray-light: #F5F7FA;
  --bg:        #f0f4f8;
  --success:   #1a7a4a;
  --error:     #c0392b;
  --border-radius: 10px;
  --box-shadow: 0 4px 15px rgba(20, 20, 20, 0.05), 0 1px 5px rgba(20, 20, 20, 0.03);
  --box-shadow-hover: 0 8px 25px rgba(20, 20, 20, 0.08), 0 2px 8px rgba(20, 20, 20, 0.04);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--black);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header Styles */
header {
  background-color: var(--blue-dark);
  color: var(--white);
  padding: 2.5rem 1.5rem;
  text-align: center;
  border-bottom: 4px solid var(--blue-med);
}

header .header-container {
  max-width: 600px;
  margin: 0 auto;
}

header .logo {
  max-height: 70px;
  width: auto;
  margin-bottom: 1.2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

header p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

/* Main Container */
main {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.2rem;
}

/* Progress / Stepper Styling */
.progress-container {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 2rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--blue-dark);
}

.progress-bar-bg {
  background-color: var(--gray-light);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(0,0,0,0.05);
}

.progress-bar-fill {
  background-color: var(--blue-med);
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stepper Icons / Labels (For Visual Polish) */
.stepper-steps {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  position: relative;
}

.stepper-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
}

.stepper-step::before {
  content: "";
  position: absolute;
  top: 12px;
  left: -50%;
  width: 100%;
  height: 2px;
  background-color: var(--gray);
  z-index: -1;
}

.stepper-step:first-child::before {
  display: none;
}

.stepper-step .step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: var(--white);
  border: 2px solid var(--gray);
  color: var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  transition: all 0.3s ease;
}

.stepper-step .step-label {
  font-size: 0.75rem;
  color: var(--gray);
  font-weight: 600;
  transition: all 0.3s ease;
}

/* Active and Completed Stepper States */
.stepper-step.active .step-num {
  border-color: var(--blue-med);
  background-color: var(--blue-med);
  color: var(--white);
  box-shadow: 0 0 0 3px rgba(40, 100, 180, 0.15);
}

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

.stepper-step.completed .step-num {
  border-color: var(--success);
  background-color: var(--success);
  color: var(--white);
}

.stepper-step.completed .step-label {
  color: var(--success);
}

.stepper-step.completed::before {
  background-color: var(--success);
}

.stepper-step.active::before {
  background-color: var(--blue-med);
}

/* Step Card Styles (Forms container) */
.step-card {
  display: none; /* Hide by default */
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 2rem;
  margin-bottom: 2.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.step-card.active {
  display: block; /* Show active card */
}

.step-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--blue-med);
}

.step-card h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-light);
  padding-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.step-card h2 .badge {
  font-size: 0.75rem;
  background-color: var(--blue-dark);
  color: var(--white);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-weight: 600;
}

/* Form Layout System */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.nested-grid-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

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

.form-group.full-width {
  grid-column: 1 / -1;
}

/* Label Styling */
label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
}

label .required-indicator {
  color: var(--error);
  margin-left: 3px;
  font-weight: 700;
}

/* Form Controls */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--black);
  background-color: var(--white);
  border: 1.5px solid var(--gray);
  border-radius: 6px;
  transition: all 0.2s ease-in-out;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--blue-med);
  box-shadow: 0 0 0 3px rgba(40, 100, 180, 0.1);
  background-color: var(--white);
}

/* Placeholders */
input::placeholder {
  color: #a0a0a0;
  opacity: 1;
}

/* Radio Button Styling */
.radio-group {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.25rem;
}

.radio-option {
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  padding: 0.5rem 0;
}

.radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.radio-checkmark {
  position: relative;
  display: inline-block;
  height: 20px;
  width: 20px;
  background-color: var(--white);
  border: 1.5px solid var(--gray);
  border-radius: 50%;
  margin-right: 0.5rem;
  transition: all 0.2s ease;
}

.radio-option:hover input ~ .radio-checkmark {
  border-color: var(--blue-med);
}

.radio-option input:checked ~ .radio-checkmark {
  border-color: var(--blue-med);
  background-color: var(--white);
}

.radio-checkmark::after {
  content: "";
  position: absolute;
  display: none;
  top: 5px;
  left: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-med);
}

.radio-option input:checked ~ .radio-checkmark::after {
  display: block;
}

.radio-label-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--black);
}

/* Checkbox Confirmation Styling */
.checkbox-group {
  margin-top: 1rem;
}

.checkbox-option {
  display: flex;
  align-items: flex-start;
  position: relative;
  cursor: pointer;
  padding: 0.5rem 0;
}

.checkbox-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkbox-checkmark {
  position: relative;
  display: inline-block;
  height: 20px;
  min-width: 20px;
  width: 20px;
  background-color: var(--white);
  border: 1.5px solid var(--gray);
  border-radius: 4px;
  margin-right: 0.75rem;
  margin-top: 2px;
  transition: all 0.2s ease;
}

.checkbox-option:hover input ~ .checkbox-checkmark {
  border-color: var(--blue-med);
}

.checkbox-option input:checked ~ .checkbox-checkmark {
  border-color: var(--blue-med);
  background-color: var(--blue-med);
}

.checkbox-checkmark::after {
  content: "";
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-option input:checked ~ .checkbox-checkmark::after {
  display: block;
}

.checkbox-label-text {
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--black);
  user-select: none;
}

/* Error States */
.form-group.has-error input,
.form-group.has-error select {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
  background-color: #fffdfd;
}

.form-group.has-error input:focus,
.form-group.has-error select:focus {
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

.error-message {
  color: var(--error);
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
}

.error-message::before {
  content: "⚠";
  margin-right: 4px;
  font-size: 0.9rem;
}

/* Button & Actions Styling */
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-light);
}

.btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  min-height: 44px; /* Compliance with touch target guidelines */
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--blue-med);
  color: var(--white);
  box-shadow: 0 2px 5px rgba(40, 100, 180, 0.2);
}

.btn-primary:hover {
  background-color: var(--blue-dark);
  box-shadow: 0 4px 10px rgba(20, 80, 160, 0.3);
}

.btn-secondary {
  background-color: var(--white);
  color: var(--blue-med);
  border: 1.5px solid var(--blue-med);
}

.btn-secondary:hover {
  background-color: var(--gray-light);
  color: var(--blue-dark);
  border-color: var(--blue-dark);
}

.btn-submit {
  background-color: var(--success);
  color: var(--white);
  box-shadow: 0 2px 5px rgba(26, 122, 74, 0.2);
}

.btn-submit:hover {
  background-color: #145e39;
  box-shadow: 0 4px 10px rgba(20, 94, 57, 0.3);
}

.btn:disabled {
  background-color: var(--gray);
  color: rgba(255, 255, 255, 0.8);
  border: none;
  cursor: not-allowed;
  box-shadow: none;
}

/* Footer Section */
footer {
  text-align: center;
  padding: 2rem 0;
  margin-top: 3rem;
  font-size: 0.8rem;
  color: #70757a;
  border-top: 1px solid rgba(0,0,0,0.05);
}

footer .developed-by {
  margin-top: 0.5rem;
  font-size: 0.75rem;
}

footer .developed-by a {
  color: var(--blue-med);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

footer .developed-by a:hover {
  text-decoration: underline;
  color: var(--blue-dark);
}

/* Success Screen Styles */
.success-screen {
  background-color: var(--success);
  color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 3.5rem 2rem;
  text-align: center;
  margin-top: 1rem;
  margin-bottom: 2.5rem;
  animation: fadeIn 0.5s ease-out;
}

.success-screen .success-logo {
  max-height: 80px;
  width: auto;
  margin-bottom: 2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.success-screen h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.success-screen p {
  font-size: 1.15rem;
  opacity: 0.95;
  line-height: 1.6;
}

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

/* ==========================================================================
   Media Queries & Responsiveness
   ========================================================================== */

/* Mobile-first layout: 1 column by default. 
   On tablet & desktop, expand layout to 2/3 columns where appropriate. */
@media (min-width: 600px) {
  main {
    padding: 0 2rem;
  }

  .form-grid {
    grid-template-columns: repeat(12, 1fr);
  }

  .nested-grid-container {
    grid-template-columns: repeat(2, 1fr);
    align-items: end;
  }

  /* Grid layout columns helper classes */
  .col-12 { grid-column: span 12; }
  .col-8  { grid-column: span 8; }
  .col-6  { grid-column: span 6; }
  .col-4  { grid-column: span 4; }
  .col-3  { grid-column: span 3; }
  
  header h1 {
    font-size: 2.25rem;
  }
  
  .stepper-step .step-label {
    font-size: 0.8rem;
  }
  
  .stepper-step .step-num {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }

  .stepper-step::before {
    top: 15px;
  }
}

@media (max-width: 480px) {
  .stepper-step .step-label {
    display: none; /* Hide labels on very narrow screens, numbers only */
  }
  
  .progress-container {
    padding: 1rem;
  }
  
  .progress-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .step-card {
    padding: 1.25rem;
  }
}
