/* Kloud Careers — application modal.
   Palette and type match the careers page (#k-car-page-wrapper). */

.kc-modal {
  --kc-blue: #0A46E8;
  --kc-cyan: #12C7D3;
  --kc-navy: #03145C;
  --kc-slate: #5B6FA8;
  --kc-border: rgba(3, 20, 92, 0.10);
  --kc-danger: #D92D20;

  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.kc-modal[hidden] { display: none !important; }
.kc-modal * { box-sizing: border-box; }

.kc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 20, 92, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: kcFade 0.25s ease;
}

.kc-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(3, 20, 92, 0.28);
  padding: 40px;
  animation: kcRise 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes kcFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes kcRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .kc-modal-backdrop, .kc-modal-dialog { animation: none; }
}

.kc-modal .kc-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0; /* the theme puts padding on every <button>, which crushes the icon */
  border: 1px solid var(--kc-border);
  border-radius: 50%;
  background: #fff;
  color: var(--kc-navy);
  cursor: pointer;
  transition: all 0.2s ease;
}
.kc-modal .kc-modal-close:hover { background: var(--kc-navy); color: #fff; border-color: var(--kc-navy); }
.kc-modal .kc-modal-close svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Head */
.kc-eyebrow {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--kc-blue);
  margin-bottom: 10px;
}
.kc-modal-head h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--kc-navy);
  margin: 0 0 8px;
  letter-spacing: -0.5px;
  line-height: 1.25;
}
.kc-modal-head p { margin: 0 0 28px; color: var(--kc-slate); font-size: 0.95rem; line-height: 1.6; }

/* Fields */
.kc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.kc-field { display: flex; flex-direction: column; }
.kc-field-full { margin-top: 18px; }

.kc-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--kc-navy);
  margin-bottom: 7px;
}
.kc-modal .kc-req { color: var(--kc-danger); }

.kc-field input[type="text"],
.kc-field input[type="email"],
.kc-field input[type="tel"],
.kc-field input[type="url"],
.kc-field select,
.kc-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--kc-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--kc-navy);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.kc-field textarea { resize: vertical; min-height: 84px; }

.kc-field input:focus,
.kc-field select:focus,
.kc-field textarea:focus {
  outline: none;
  border-color: var(--kc-blue);
  box-shadow: 0 0 0 3px rgba(10, 70, 232, 0.12);
}

.kc-field.kc-invalid input,
.kc-field.kc-invalid select,
.kc-field.kc-invalid .kc-drop {
  border-color: var(--kc-danger);
}
.kc-error { font-size: 0.78rem; color: var(--kc-danger); margin-top: 6px; }

/* Resume upload */
.kc-file-input {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.kc-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 26px 20px;
  border: 1.5px dashed rgba(10, 70, 232, 0.28);
  border-radius: 10px;
  background: rgba(10, 70, 232, 0.02);
  color: var(--kc-slate);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}
.kc-drop:hover, .kc-drop.kc-dragover { background: rgba(10, 70, 232, 0.06); border-color: var(--kc-blue); }
.kc-drop svg { width: 26px; height: 26px; color: var(--kc-blue); }
.kc-drop-text { font-weight: 600; font-size: 0.9rem; color: var(--kc-navy); }
.kc-modal .kc-drop-hint { font-size: 0.78rem; color: var(--kc-slate); font-weight: 400; }
.kc-drop.kc-has-file { border-style: solid; border-color: var(--kc-cyan); background: rgba(18, 199, 211, 0.06); }

/* Honeypot */
.kc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Status + submit */
.kc-status { margin-top: 18px; font-size: 0.88rem; }
.kc-status:empty { margin-top: 0; }
.kc-status.kc-status-error {
  color: var(--kc-danger);
  background: rgba(217, 45, 32, 0.07);
  border: 1px solid rgba(217, 45, 32, 0.2);
  border-radius: 8px;
  padding: 11px 14px;
}

.kc-modal .kc-submit {
  margin-top: 22px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 28px;
  border: 0;
  border-radius: 8px;
  background: var(--kc-blue);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 8px 22px rgba(10, 70, 232, 0.22);
}
.kc-modal .kc-submit:hover:not(:disabled) { background: #0734b0; transform: translateY(-1px); }
.kc-modal .kc-submit:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }
.kc-modal .kc-submit.kc-loading .kc-submit-arrow { display: none; }

.kc-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: kcSpin 0.7s linear infinite;
}
@keyframes kcSpin { to { transform: rotate(360deg); } }

.kc-privacy { margin: 14px 0 0; font-size: 0.76rem; color: var(--kc-slate); text-align: center; line-height: 1.5; }

/* Success */
.kc-success { text-align: center; padding: 20px 0 6px; }
.kc-success-icon {
  width: 62px; height: 62px;
  margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(18, 199, 211, 0.12);
  color: var(--kc-cyan);
}
.kc-success-icon svg { width: 30px; height: 30px; }
.kc-success h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.4rem; font-weight: 700; color: var(--kc-navy); margin: 0 0 10px;
}
.kc-success p { color: var(--kc-slate); font-size: 0.95rem; line-height: 1.65; margin: 0 auto; max-width: 420px; }
.kc-modal .kc-success-close { max-width: 200px; margin-left: auto; margin-right: auto; }

body.kc-modal-open { overflow: hidden; }

@media (max-width: 640px) {
  .kc-modal { padding: 0; }
  .kc-modal-dialog { padding: 30px 22px; border-radius: 0; max-height: 100vh; height: 100%; }
  .kc-grid { grid-template-columns: 1fr; gap: 14px; }
  .kc-modal-head h2 { font-size: 1.4rem; }
}
