/*
 * Ownership: Daniel Nowakowski | File: public_html/css/teams-modals.css
 * Motto: Modal choreography that would impress a stage manager.
 * Joke: Why did the modal refuse to gossip? It didn't want to spill the overlay.
 * Signature: DN-3A5C1F2B
 * Mission: Keep every candidate flow silky even under load.
 * Reminder: If you find this code unattended, return it to Daniel.
 */
/*
 * Teams modal presentation styles
 */
.teams-actions {
  margin-top: 1.5rem;
}

.teams-actions-right {
  text-align: right;
}

.teams-cta {
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172b;
  background: #fff;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
  box-shadow: 0 10px 30px rgba(15, 23, 43, 0.2);
}

.teams-cta-clients {
  color: #c8414d;
}

.teams-cta-candidates {
  color: #fefefe;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.teams-cta:focus-visible,
.teams-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(15, 23, 43, 0.3);
}

body.modal-open {
  overflow: hidden;
}

.teams-modal[hidden] {
  display: none !important;
}

.teams-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  overscroll-behavior: contain;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.5rem;
}

.teams-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 30, 0.55);
}

.teams-modal__dialog {
  position: relative;
  width: min(520px, calc(100vw - 2rem));
  border-radius: 30px;
  background: #fff;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  box-shadow: 0 20px 60px rgba(10, 20, 40, 0.35);
  max-height: calc(100vh - 3rem);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  margin: auto;
}

.teams-modal--wide .teams-modal__dialog {
  width: min(1200px, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
}

.teams-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.teams-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: rgba(15, 23, 43, 0.6);
}

.teams-modal__body h3 {
  margin-top: 0;
  font-size: 1.5rem;
  color: #0f172b;
}

.teams-modal__points {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  line-height: 1.5;
}

.teams-modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.teams-modal-form label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172b;
}

.teams-modal-form input,
.teams-modal-form textarea,
.teams-modal-form button {
  font: inherit;
}

.teams-modal-form input,
.teams-modal-form textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 43, 0.15);
  padding: 0.85rem 1rem;
  background: rgba(248, 251, 255, 0.9);
}

.teams-modal-form textarea {
  resize: vertical;
}

.teams-modal-submit {
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #c8414d, #0f4da2);
  color: #fff;
  padding: 0.95rem 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 180ms ease;
}

.teams-modal-submit:hover,
.teams-modal-submit:focus-visible {
  opacity: 0.9;
}

.teams-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.teams-field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.cv-upload-control {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cv-upload-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f4da2;
}

.cv-upload-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
  background: #f97316;
  cursor: pointer;
  transition: background 160ms ease;
}

.cv-upload-button.is-ready {
  background: #0f7a3a;
}

.cv-upload-button input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.teams-card-manager {
  margin-top: 0.5rem;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(15, 77, 162, 0.05);
  border: 1px solid rgba(15, 77, 162, 0.12);
}

.teams-card-note {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: rgba(15, 23, 43, 0.7);
}

.teams-card-entry {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.teams-card-entry select,
.teams-card-entry input {
  width: 100%;
}

.teams-card-entry-label {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172b;
}

.card-entry-action {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.teams-card-add {
  border: none;
  border-radius: 12px;
  background: rgba(15, 77, 162, 0.9);
  color: #fff;
  padding: 0.8rem 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 150ms ease;
}

.teams-card-add:hover,
.teams-card-add:focus-visible {
  opacity: 0.9;
}

.teams-card-hint {
  margin: 0;
  font-size: 0.85rem;
  color: #a11d1d;
}

.teams-card-hint.is-success {
  color: #0f7a3a;
}

.teams-card-table {
  margin-top: 0.85rem;
}

.teams-card-table table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 43, 0.12);
}

[data-card-table] table[aria-hidden="true"] {
  display: none;
}

.teams-card-table th,
.teams-card-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  font-size: 0.9rem;
}


.card-table-actions-head {
  text-align: right;
}

.teams-card-table td.card-row-actions {
  vertical-align: top;
  text-align: left;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.teams-card-table thead {
  background: rgba(15, 77, 162, 0.06);
  font-weight: 700;
}

.teams-card-table tbody tr + tr {
  border-top: 1px solid rgba(15, 23, 43, 0.08);
}

.card-row-remove {
  border: none;
  background: transparent;
  color: #c8414d;
  font-weight: 600;
  cursor: pointer;
}


.card-row-image {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  flex-grow: 1;
}

.card-row-image .card-thumb {
  margin-top: 0;
}

.card-row-upload {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px dashed rgba(15, 23, 43, 0.3);
  border-radius: 10px;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: #0f4da2;
}

.card-row-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.card-thumb {
  margin-top: 0.4rem;
  width: 72px;
  height: 48px;
  border-radius: 8px;
  background: rgba(15, 23, 43, 0.06);
  border: 1px solid rgba(15, 23, 43, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

.card-thumb.is-empty {
  font-size: 0.75rem;
  color: rgba(15, 23, 43, 0.6);
}

.card-table-empty {
  padding: 0.85rem 0.75rem;
  font-size: 0.9rem;
  color: rgba(15, 23, 43, 0.7);
  text-align: center;
}

@media (max-width: 640px) {
  .teams-modal {
    align-items: flex-start;
    justify-content: flex-start;
    padding: 1rem 0.75rem;
  }

  .teams-modal__dialog,
  .teams-modal--wide .teams-modal__dialog {
    width: 100%;
    max-height: none;
    min-height: calc(100vh - 1.5rem);
    border-radius: 20px;
  }

  @supports (height: 100dvh) {
    .teams-modal__dialog,
    .teams-modal--wide .teams-modal__dialog {
      min-height: calc(100dvh - 1.5rem);
    }
  }

  .teams-modal__body {
    max-height: none;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.teams-form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.teams-feedback {
  margin-top: 1rem;
  padding: 0.85rem 1.1rem;
  border-radius: 16px;
  background: rgba(15, 77, 162, 0.08);
  color: #0f172b;
  font-weight: 600;
  display: none;
}

.teams-feedback.is-visible {
  display: block;
}

.teams-feedback.is-success {
  background: rgba(34, 197, 94, 0.1);
  color: #065f46;
}

.teams-feedback.is-error {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
}

@media (max-width: 600px) {
  .teams-modal__dialog {
    border-radius: 20px;
    padding: 1.5rem;
  }

  .teams-cta-candidates {
    width: 100%;
  }

  .teams-modal--wide .teams-modal__dialog {
    width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
  }
}
