* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f5f7fb;
  color: #061a44;
}

body.modal-open {
  overflow: hidden;
}

button,
textarea,
select {
  font-family: inherit;
}

.project-page {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.project-page .dash-sidebar {
  min-height: 100vh;
}

.project-detail-main {
  min-width: 0;
  padding: 38px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 22px;
  color: #15993a;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.back-link:hover {
  text-decoration: underline;
}

.project-detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  padding: 30px;
  border-radius: 22px;
  background:
    radial-gradient(
      circle at 90% 10%,
      rgba(105, 56, 201, 0.22),
      transparent 30%
    ),
    linear-gradient(
      135deg,
      #061a44,
      #0d2d67
    );
  color: #ffffff;
  box-shadow: 0 20px 46px rgba(6, 26, 68, 0.16);
}

.project-detail-brand {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.project-detail-logo {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: linear-gradient(
    135deg,
    #35c759,
    #5f7eea
  );
  color: #061a44;
  font-size: 22px;
  font-weight: 900;
}

.project-detail-sector {
  margin: 0 0 8px;
  color: #72e392;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-detail-hero h1 {
  margin: 0;
  font-size: 38px;
  letter-spacing: -0.04em;
}

.project-detail-description {
  max-width: 760px;
  margin: 13px 0 0;
  color: #c7d2e5;
  line-height: 1.65;
}

.apply-large-button {
  flex: 0 0 auto;
  min-height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: 11px;
  background: #35c759;
  color: #061a44;
  cursor: pointer;
  font-weight: 900;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.apply-large-button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: #5bd876;
}

.project-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  margin-top: 24px;
}

.project-detail-content,
.project-detail-sidebar {
  display: grid;
  align-content: start;
  gap: 20px;
}

.project-info-card {
  padding: 24px;
  border: 1px solid #e2e8f1;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(6, 26, 68, 0.05);
}

.project-info-card h2 {
  margin: 0 0 16px;
  font-size: 22px;
}

.project-info-card > p {
  margin: 0;
  color: #5f6b82;
  line-height: 1.7;
}

.detail-role-list {
  display: grid;
  gap: 12px;
}

.detail-role-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px;
  border: 1px solid #e7ecf3;
  border-radius: 13px;
  background: #f8fafc;
}

.detail-role-item p {
  margin: 5px 0 0;
  color: #6f7b90;
  font-size: 12px;
}

.detail-role-item button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: #35c759;
  color: #061a44;
  cursor: pointer;
  font-weight: 900;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.detail-role-item button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #5bd876;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.detail-tags span {
  padding: 8px 11px;
  border-radius: 999px;
  background: #e9f8ee;
  color: #15993a;
  font-size: 12px;
  font-weight: 800;
}

.impact-card {
  border-color: #cfead8;
  background: #edf9f1;
}

.detail-facts {
  display: grid;
  gap: 14px;
}

.detail-facts div {
  padding-bottom: 13px;
  border-bottom: 1px solid #e9edf3;
}

.detail-facts div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.detail-facts span,
.detail-facts strong {
  display: block;
}

.detail-facts span {
  margin-bottom: 5px;
  color: #8a95a8;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-founder {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-founder-avatar {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e9f8ee;
  color: #15993a;
  font-weight: 900;
}

.detail-founder p {
  margin: 4px 0;
  color: #5f6b82;
  font-size: 13px;
}

.detail-founder span {
  color: #8a95a8;
  font-size: 12px;
}

.founder-profile-link {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  border: 1px solid #d8e0ef;
  border-radius: 10px;
  color: #061a44;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.founder-profile-link:hover {
  border-color: #35c759;
  background: #e9f8ee;
}

/* =========================================================
   APPLICATION MODAL
========================================================= */

.application-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 15, 40, 0.72);
}

.application-modal.open {
  display: flex;
}

.application-modal-card {
  position: relative;
  width: min(100%, 620px);
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3);
}

.close-application-modal {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #eef1f5;
  color: #061a44;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.close-application-modal:hover {
  background: #e2e7ee;
}

.application-label {
  margin: 0 0 8px;
  color: #15993a;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.application-modal-card h2 {
  margin: 0 0 24px;
  padding-right: 42px;
}

.application-modal-card label {
  display: block;
  margin: 16px 0 7px;
  font-size: 13px;
  font-weight: 800;
}

.application-modal-card textarea,
.application-modal-card select {
  width: 100%;
  padding: 13px;
  border: 1px solid #d8e0ef;
  border-radius: 10px;
  outline: none;
  background: #f8fafc;
  color: #061a44;
  font: inherit;
}

.application-modal-card textarea {
  resize: vertical;
}

.application-modal-card textarea:focus,
.application-modal-card select:focus {
  border-color: #35c759;
  box-shadow: 0 0 0 3px rgba(53, 199, 89, 0.12);
}

.submit-application-button {
  width: 100%;
  min-height: 48px;
  margin-top: 22px;
  border: 0;
  border-radius: 10px;
  background: #35c759;
  color: #061a44;
  cursor: pointer;
  font-weight: 900;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.submit-application-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #5bd876;
}

.submit-application-button:disabled,
.apply-large-button:disabled,
.detail-role-item button:disabled {
  cursor: default;
  opacity: 0.72;
}

button.application-submitted,
button.application-submitted:hover {
  background: #eaf8ed;
  color: #16843a;
  cursor: default;
  opacity: 1;
  transform: none;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1000px) {
  .project-detail-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

@media (max-width: 900px) {
  .project-page {
    display: block;
  }

  .project-detail-main {
    padding: 26px 20px;
  }

  .project-detail-grid {
    grid-template-columns: 1fr;
  }

  .project-detail-hero {
    flex-direction: column;
  }

  .apply-large-button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .project-detail-main {
    padding: 20px 14px;
  }

  .project-detail-hero {
    padding: 22px;
  }

  .project-detail-brand {
    flex-direction: column;
  }

  .project-detail-hero h1 {
    font-size: 31px;
  }

  .project-info-card {
    padding: 19px;
  }

  .detail-role-item {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-role-item button {
    width: 100%;
  }

  .application-modal {
    padding: 10px;
  }

  .application-modal-card {
    padding: 24px 18px;
  }
}