/* ═══════════════════════════════════════════════
   Clean Energy Careers — Front-end Styles
   ═══════════════════════════════════════════════ */

:root {
  --cec-green:       #1a5c38;
  --cec-green-light: #e8f5ee;
  --cec-green-mid:   #2d7a50;
  --cec-text:        #1a1a1a;
  --cec-muted:       #6b7280;
  --cec-border:      #e5e7eb;
  --cec-white:       #ffffff;
  --cec-bg:          #f9fafb;
  --cec-radius:      12px;
  --cec-shadow:      0 2px 12px rgba(0,0,0,.07);
}

/* ── Section wrapper ── */
.cec-careers {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px;
  font-family: inherit;
}

/* ── Header ── */
.cec-careers__header {
  text-align: center;
  margin-bottom: 40px;
  background: transparent;
  box-shadow: none;
  position: relative;
}
.cec-careers__title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--cec-text);
  margin: 0 0 10px;
}
.cec-careers__subtitle {
  font-size: 1rem;
  color: var(--cec-muted);
  margin: 0;
}

/* ── Grid ── */
.cec-jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 24px;
}
@media (max-width: 600px) {
  .cec-jobs-grid { grid-template-columns: 1fr; }
}

/* ── Card ── */
.cec-job-card {
  background: var(--cec-white);
  border: 1px solid var(--cec-border);
  border-radius: var(--cec-radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--cec-shadow);
  transition: box-shadow .2s;
}
.cec-job-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.10);
}

/* ── Badges ── */
.cec-job-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cec-badge {
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .02em;
}
.cec-badge--type {
  background: var(--cec-green-light);
  color: var(--cec-green);
  border: 1px solid #b6dfc9;
}
.cec-badge--location {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
.cec-badge--salary {
  background: #fefce8;
  color: #854d0e;
  border: 1px solid #fde68a;
}

/* ── Title ── */
.cec-job-card__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cec-text);
  margin: 0;
  line-height: 1.3;
}

.cec-job-card__description {
  font-size: .9rem;
  color: var(--cec-muted);
  margin: 0;
  line-height: 1.5;
}

/* ── Section label ── */
.cec-job-card__section-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--cec-muted);
  margin: 0 0 8px;
}

/* ── Responsibility list ── */
.cec-job-card__list {
  margin: 0;
  padding: 0 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cec-job-card__list li {
  font-size: .88rem;
  color: #374151;
  line-height: 1.5;
}

/* ── Metrics tags ── */
.cec-metrics-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cec-metric-tag {
  background: var(--cec-green);
  color: var(--cec-white);
  font-size: .76rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  line-height: 1.3;
}

/* ── Apply button ── */
.cec-apply-btn {
  display: block;
  width: 100%;
  margin-top: auto;
  padding: 14px;
  background: var(--cec-green);
  color: var(--cec-white);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s;
  text-align: center;
}
.cec-apply-btn:hover {
  background: var(--cec-green-mid);
}
.cec-apply-btn:active {
  transform: scale(.98);
}

.cec-no-jobs {
  text-align: center;
  color: var(--cec-muted);
  padding: 40px;
}

/* ═══════════════════════════════════════════════
   Modal
   ═══════════════════════════════════════════════ */

/* Scroll lock — added to <html> when modal opens */
html.cec-modal-open,
html.cec-modal-open body {
  overflow: hidden !important;
  height: 100vh !important;
}

.cec-modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0,0,0,.65) !important;
  z-index: 9999999 !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  padding: 20px !important;
  box-sizing: border-box !important;
  /* Use visibility + opacity so hidden modal can't receive clicks */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s, visibility .25s;
  /* Reset any theme transforms that create a new stacking context */
  transform: none !important;
  isolation: isolate;
  contain: none !important;
  margin: 0 !important;
}
.cec-modal-overlay.cec-open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.cec-modal {
  background: var(--cec-white);
  border-radius: var(--cec-radius);
  width: 100%;
  max-width: 580px;
  /* No max-height or overflow — modal grows naturally, overlay scrolls */
  overflow-y: auto;
  padding: 36px;
  position: relative;
  transform: translateY(24px);
  transition: transform .25s;
  box-shadow: 0 24px 80px rgba(0,0,0,.3);
  box-sizing: border-box;
  flex-shrink: 0;
  margin: auto;
}
.cec-modal-overlay.cec-open .cec-modal {
  transform: translateY(0);
}

.cec-modal__close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--cec-muted);
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
}
.cec-modal__close:hover { background: var(--cec-bg); }

.cec-modal__header { margin-bottom: 24px; }
.cec-modal__header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--cec-text);
}
.cec-modal__header p {
  font-size: .875rem;
  color: var(--cec-muted);
  margin: 0;
}

/* ── Form ── */
#cec-application-form { display: flex; flex-direction: column; gap: 16px; }

.cec-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 480px) {
  .cec-form-row { grid-template-columns: 1fr; }
}

.cec-form-field { display: flex; flex-direction: column; gap: 5px; }
.cec-form-field label {
  font-size: .82rem;
  font-weight: 600;
  color: #374151;
}
.cec-form-field label span { color: #ef4444; }

.cec-form-field input,
.cec-form-field textarea,
.cec-form-field select {
  border: 1px solid var(--cec-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .9rem;
  color: var(--cec-text);
  transition: border-color .15s;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}
.cec-form-field textarea {
  overflow: hidden;
  resize: none;
  min-height: 100px;
}
.cec-form-field input:focus,
.cec-form-field textarea:focus {
  outline: none;
  border-color: var(--cec-green);
  box-shadow: 0 0 0 3px rgba(26,92,56,.1);
}

/* ── Upload area ── */
.cec-upload-area {
  position: relative;
  border: 2px dashed var(--cec-border);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.cec-upload-area:hover,
.cec-upload-area.drag-over {
  border-color: var(--cec-green);
  background: var(--cec-green-light);
}
.cec-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
}
.cec-upload-ui { pointer-events: none; }
.cec-upload-ui svg { color: var(--cec-green); margin-bottom: 8px; }
.cec-upload-ui p { font-size: .9rem; color: #374151; margin: 0 0 4px; }
.cec-upload-ui span { font-size: .78rem; color: var(--cec-muted); }

.cec-file-selected {
  font-size: .82rem;
  color: var(--cec-green);
  font-weight: 600;
  margin-top: 8px;
}

/* ── Error ── */
.cec-form-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .85rem;
  display: none;
}
.cec-form-error.visible { display: block; }

/* ── Submit ── */
.cec-submit-btn {
  background: var(--cec-green);
  color: var(--cec-white);
  border: none;
  border-radius: 8px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.cec-submit-btn:hover:not(:disabled) { background: var(--cec-green-mid); }
.cec-submit-btn:disabled { opacity: .65; cursor: not-allowed; }

.cec-btn-loader svg {
  animation: cec-spin 1s linear infinite;
}
@keyframes cec-spin {
  to { transform: rotate(360deg); }
}

/* ── Success ── */
.cec-success-message {
  text-align: center;
  padding: 20px 0;
}
.cec-success-icon { margin-bottom: 16px; }
.cec-success-message h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--cec-text);
}
.cec-success-message p {
  color: var(--cec-muted);
  margin: 0 0 24px;
  font-size: .9rem;
  line-height: 1.6;
}

/* ── Phone icon wrapper ── */
.cec-input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.cec-input-icon {
  position: absolute;
  left: 12px;
  font-size: .95rem;
  pointer-events: none;
  line-height: 1;
  z-index: 1;
}
.cec-input-icon-wrap input.cec-has-icon {
  padding-left: 36px;
  width: 100%;
}

/* ── Remove number spinners from tel/number inputs ── */
input[type="tel"]::-webkit-inner-spin-button,
input[type="tel"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="tel"],
input[type="number"] {
  -moz-appearance: textfield;
}

/* ── All form fields equal height ── */
.cec-form-field input,
.cec-form-field select {
  height: 44px;
}

/* ── Modal scroll fix ── */
.cec-modal-overlay {
  overflow-y: auto !important;
  align-items: flex-start !important;
  padding: 40px 20px !important;
}
.cec-modal {
  overflow: visible !important;
  max-height: none !important;
  margin: auto !important;
  flex-shrink: 0 !important;
}
#cec-application-form {
  overflow: visible !important;
}

/* ── Header fix — no box, transparent bg ── */
.cec-careers__header {
  background: transparent !important;
  box-shadow: none !important;
  position: relative !important;
}
.cec-careers__title {
  color: #ffffff !important;
}
.cec-careers__subtitle {
  color: rgba(255,255,255,0.80) !important;
}

/* ── Header text white fix ── */
.cec-careers__title {
  color: #171717 !important;
}
.cec-careers__subtitle {
  color: #171717 !important;
}

/* ── Header final fix ── */
.cec-careers__header {
  background: transparent !important;
  box-shadow: none !important;
  position: relative !important;
}
.cec-careers__title {
  color: #1a1a1a !important;
}
.cec-careers__subtitle {
  color: #6b7280 !important;
}
