/* Applicant page styles - public/style.css
   Basic layout: 3 columns inside a centered panel.
   Updated: hover animation and drag-to-upload visual state for image upload.
*/

:root{
  --panel-bg: rgba(0,0,0,0.62);
  --muted: #cfdaf0;
  --accent: #4ac29a;
  --accent-strong: rgba(74,194,154,0.95);
  --danger: #ff4d4f;
  --radius: 12px;
  --max-width: 1200px;
  --gap: 20px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html,body{
  height:100vh;
  margin:0;
  padding:0;
  font-family: Arial, Helvetica, sans-serif;
  background: url('bg.gif') no-repeat center center fixed;
  background-size: cover;
  color: #fff;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  overflow: hidden; /* prevent the whole page from scrolling */
}

/* Container */
#apply-panel{
  width: 95%;
  max-width: var(--max-width);
  margin: 0; /* center via fixed positioning instead of page flow */
  background: var(--panel-bg);
  border-radius: calc(var(--radius) + 6px);
  padding: 24px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.03);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 720px; /* keep the panel within the viewport */
  box-sizing: border-box;
  overflow: hidden; /* disallow page scroll; internal columns may scroll if needed */
}

/* Title */
#apply-panel > h1{
  margin: 0 0 18px 0;
  font-size: 1.45rem;
  letter-spacing: 0.2px;
  color: #fff;
  text-align: center;
}

/* Inner grid: 3 columns
   Use grid-auto-rows + stretch so columns always match heights. */
#panel-inner{
  display: grid;
  grid-template-columns: 260px 1fr 300px;
  gap: var(--gap);
  align-items: stretch;        /* ensure columns stretch to same height */
  grid-auto-rows: 1fr;         /* makes rows expand equally */
}

/* Column boxes: make them flex-columns so content flows and can stretch */
#col-steps, #col-form, #col-resources{
  background: rgba(24,24,24,0.45);
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.03);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 320px;
  height: 100%; /* ensure they fill the grid row height */
  box-sizing: border-box;
  overflow: hidden;
}

/* Steps column */
#col-steps h2,
#col-resources h2{
  margin:0 0 4px 0;
  font-size:1.05rem;
  color: #eafaf1;
}
#col-steps ol{
  margin:0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}
#col-steps li{
  margin-bottom: 10px;
}

/* Form column */
#col-form{
  display:flex;
  flex-direction:column;
  gap:12px;
  justify-content: flex-start;
  overflow: auto;
  padding-right: 6px; /* small padding to avoid scrollbar overlap */
}

.form-row{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-bottom: 6px;
}
.form-row.two-up{
  display:flex;
  gap:12px;
}
.form-row.two-up > div{
  flex:1;
}

/* Labels and inputs */
label{
  color: var(--muted);
  font-weight:600;
  font-size:0.95rem;
}
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="url"],
textarea,
input[type="file"]{
  width:100%;
  padding:10px 12px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.04);
  background: rgba(0,0,0,0.45);
  color: #fff;
  outline:none;
  transition: box-shadow 0.12s ease, transform 0.08s ease;
  font: inherit;
}

/* Make the native date-picker calendar icon appear white on WebKit-based browsers */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(200%) contrast(120%);
  opacity: 0.95;
}

/* Ensure date input text is visible */
input[type="date"] {
  color: #fff;
}
textarea{ min-height:84px; resize: vertical; }

input:focus, textarea:focus{
  box-shadow: 0 6px 18px var(--accent-strong, rgba(74,194,154,0.08));
  border-color: var(--accent-strong);
  transform: translateY(-1px);
}

/* Help text for resume name */
.help-text{
  margin-top:8px;
  font-size:0.9rem;
  color: #bfcbd6;
}

/* Image & resource column */
#image-upload{
  display:flex;
  flex-direction:column;
  gap:12px;
  align-items:center;
  /* ensure this column's contents push to fill height */
  flex: 1 1 auto;
}

/* Make the image placeholder expand so columns appear balanced */
.image-placeholder{
  width: 100%;
  /* fixed size so image fills a predictable box */
  height: 400px;
  background: linear-gradient(180deg, rgba(0,0,0,0.18), rgba(0,0,0,0.28));
  padding: 0; /* remove inner padding so image can fully fill the box */
  border-radius: 8px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(255,255,255,0.03);
  overflow:hidden;
  flex: 0 0 240px; /* fixed height in the layout */
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  will-change: transform, box-shadow;
  position: relative;
}
 
/* Image inside the placeholder - cover the box */
#preview-img{
  width: auto;
  height: 100%;
  object-fit: scale-down; /* fill the fixed box while maintaining aspect ratio */
  border-radius: 6px;
  display:block;
  transition: transform 0.18s ease;
}

/* image-button label wraps the image and acts like a button */
.image-button{
  display:block;
  width:100%;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

/* Hover / focus states to indicate interactable */
.image-button:hover .image-placeholder,
.image-button:focus .image-placeholder{
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 18px rgba(74,194,154,0.06);
  filter: brightness(1.02);
}
.image-button:active .image-placeholder{
  transform: translateY(-1px) scale(1.01);
}

/* subtle pulse on the image for affordance (not constant - only on hover via transform) */
.image-button:hover #preview-img{
  transform: scale(1.01);
}

/* Drag-over state - when user drags an image over the placeholder */
.image-placeholder.drag-over{
  outline: 3px dashed rgba(74,194,154,0.85);
  box-shadow: 0 12px 40px rgba(74,194,154,0.08);
  transform: translateY(-4px) scale(1.03);
  background: linear-gradient(180deg, rgba(10,40,30,0.14), rgba(10,40,30,0.22));
}

/* Visual hint text (optional) */
.image-placeholder .hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.9);
  font-size: 0.9rem;
  padding: 6px 10px;
  background: rgba(0,0,0,0.35);
  border-radius: 6px;
  pointer-events: none;
}

/* Hide the photo file input's native "Choose file" control so only the image is visible.
   The label (for="photo") will still open the file chooser. */
#photo {
  display: none;
}

/* Drive link box */
#drive-link{
  margin-top:8px;
  width:100%;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.btn-link{
  display:inline-block;
  padding:8px 10px;
  background: rgba(0,0,0,0.6);
  border-radius:8px;
  color: #dff6ea;
  text-decoration:none;
  border:1px solid rgba(255,255,255,0.03);
}
.hidden { display:none !important; }

/* Form actions - moved out under the panel; keep minimal styles for status */
.form-actions{
  display:flex;
  gap:12px;
  align-items:center;
  margin-top:8px;
}
button{
  padding:10px 14px;
  border-radius:8px;
  border:none;
  cursor:pointer;
  font-weight:700;
}
#submit-btn{
  background: linear-gradient(90deg, var(--accent-strong), rgba(74,194,154,0.7));
  color: #08291f;
  box-shadow: 0 6px 18px rgba(74,194,154,0.08);
  padding:12px 22px;
  font-size:1.05rem;
}
#submit-btn[disabled],
#submit-btn:disabled{
  opacity:0.6;
  cursor:not-allowed;
}

/* Panel submit wrapper */
#panel-submit{
  margin-top: 18px;
  display:flex;
  justify-content:center;
}

/* Status text */
#form-status{
  color: #cfece0;
  font-weight:600;
}

/* Privacy modal + backdrop (fixed panel + dim background) */
#privacy-modal {
  position: fixed;
  inset: 0; /* fill the viewport */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200; /* above the panel */
  pointer-events: none; /* default when hidden */
}

/* Backdrop covers the entire viewport and darkens the background */
#privacy-modal .modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(3px) saturate(0.9);
  pointer-events: auto;
}

/* Modal content panel */
#privacy-modal .modal-content {
  position: relative;
  width: min(760px, 94%);
  max-height: 86vh;
  background: linear-gradient(180deg, rgba(18,18,18,0.98), rgba(12,12,12,0.98));
  border-radius: 14px;
  padding: 20px 20px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.04);
  color: #e9f7f0;
  overflow: auto;
  z-index: 1210;
  pointer-events: auto;
  transform: translateY(0);
}

/* Title and body */
#privacy-modal h3#privacy-title{
  margin: 0 0 8px 0;
  font-size: 1.15rem;
  color: #dff6ea;
}
#privacy-modal .policy-body{
  color: #cfece0;
  line-height: 1.45;
  margin-bottom: 12px;
  font-size: 0.98rem;
}

/* Agreement area (checkbox + label) */
#privacy-modal .policy-agree{
  display:flex;
  gap:12px;
  align-items:flex-start;
  margin: 12px 0;
}
#privacy-modal .policy-agree input[type="checkbox"]{
  width:18px;
  height:18px;
  margin-top:4px;
  accent-color: var(--accent);
}
#privacy-modal .policy-agree label{
  color: #d0efe0;
  font-size: 0.96rem;
  line-height: 1.35;
}

/* Modal actions row */
#privacy-modal .modal-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  margin-top: 8px;
}

/* Primary and cancel buttons inside modal */
#privacy-modal .btn-primary{
  background: linear-gradient(90deg, var(--accent-strong), rgba(74,194,154,0.8));
  color: #04261e;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 800;
  border: none;
  cursor: pointer;
}
#privacy-modal .btn-primary[disabled],
#privacy-modal .btn-primary:disabled{
  opacity: 0.5;
  cursor: not-allowed;
}
#privacy-modal .btn-cancel{
  background: transparent;
  color: #dfeee6;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.03);
  cursor: pointer;
}

/* Ensure the modal is hidden when .hidden is present, and visible when removed */
#privacy-modal.hidden {
  display: none;
  pointer-events: none;
}

/* Small screens: make modal full width with comfortable padding */
@media (max-width: 520px){
  #privacy-modal .modal-content{
    width: calc(100% - 36px);
    padding: 14px;
    border-radius: 10px;
  }
}

/* Small screens: stack columns */
@media (max-width: 980px){
  #panel-inner{
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
  #col-steps, #col-resources{
    order: 2;
  }
  #col-form{ order: 1; }
  .form-row.two-up{ flex-direction: column; }
  .image-placeholder{ min-height:140px; }
}

/* Tiny screens: make panel full width and reduce spacing */
@media (max-width: 480px){
  #apply-panel{ padding:12px; margin: 18px auto; }
  #apply-panel > h1{ font-size:1.1rem; }
}

/* Accessibility focus outline */
:focus{
  outline: 3px solid rgba(74,194,154,0.18);
  outline-offset: 2px;
}

/* Mobile / phone warning panel (shown when script toggles visibility) */
#mobile-warning{
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(0,0,0,0.62), rgba(0,0,0,0.8));
  z-index: 3000;
  padding: 20px;
  box-sizing: border-box;
  color: #fff;
}

/* Inner content card */
#mobile-warning .mobile-warning-content{
  width: 100%;
  max-width: 640px;
  background: linear-gradient(180deg, rgba(18,18,18,0.98), rgba(12,12,12,0.98));
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.04);
  text-align: center;
  color: #eafaf1;
}

/* Heading and message */
#mobile-warning .mobile-warning-content h2{
  margin: 0 0 8px 0;
  font-size: 1.2rem;
  color: #dff6ea;
}
#mobile-warning .mobile-warning-content p{
  margin: 0;
  font-size: 1rem;
  color: #cfece0;
  line-height: 1.35;
  margin-bottom: 4px;
}

/* Keep existing .hidden utility consistent for the warning panel */
#mobile-warning.hidden { display: none !important; }