.main-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.form-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 1.5rem;
  width: 40rem;
  min-width: 320px;
  min-height: 28rem;
  margin: 9rem 16rem 6rem;
  transition: width 0.4s cubic-bezier(.4,1.4,.6,1), min-height 0.4s cubic-bezier(.4,1.4,.6,1);
  hr {
    color: black;
    opacity: 100%;
    margin: 0;
  }
}
.form-card.expanded {
  width: 52rem;
  padding: 1.5rem;
}

.form-row {
  label {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
  }
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #ccc;
  border-top: 3px solid #333;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.sidebar {
  position: relative;
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}
.sidebar-highlight {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  background: #082567;
  border-radius: 50px;
  transition: left 0.35s cubic-bezier(.4,1.4,.6,1), width 0.35s, background 0.2s;
  box-shadow: 0 2px 8px rgba(8, 37, 103, 0.08);
  pointer-events: none;
  height: 100%;
}
.sidebar-btn {
  font-size: 1.1rem;
  font-weight: lighter;
  position: relative;
  width: 220px;
  padding: 1rem 0;
  margin-bottom: 0;
  border-radius: 50px;
  border: none;
  background: none;
  color: var(--blue);
  cursor: pointer;
  transition: background 0.2s, color 0.1s;
  z-index: 1;
}
.sidebar-btn.active {
  color: #fff;
  font-weight: bold;
}

.sidebar-btn:not(.active) {
  color: #082567;
}

form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-control {
  font-size: 1rem;
  color: #333;
  width: 100%;
  height: 3rem;
  background: none;
  border: none;
  border-bottom: 1px solid black;
  border-radius: 0;
  box-sizing: border-box;
  padding: 0;
}

.form-control::placeholder{
  font-size: 1rem;
  font-weight: lighters;
}
.form-control:focus {
  outline: 1px solid var(--blue);
  padding: 1rem;
}
::placeholder {
  color: #b0b0b0;
  opacity: 1;
  font-weight: 400;
}

.submit-btn {
  font-size: 1rem;
  height: 2.4rem;
  background: var(--blue);
  color: white;
  border-radius: 24px;
  border: none;
  box-shadow: 0 2px 8px rgba(8, 37, 103, 0.08);
  transition: background 0.2s;
  margin-top: 1rem;
  cursor: pointer;
}
.submit-btn:hover, .submit-btn:focus {
  background-color: var(--orange);
}

.form-card form {
  width: 100%;
}

.popup-overlay {
  display: none; 
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.popup-content {
  background: #fff;
  padding: 20px 30px;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0px 8px 25px rgba(0,0,0,0.2);
  animation: fadeInScale 0.3s ease-in-out;
}

.popup-close {
  float: right;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  color: #666;
}

.popup-close:hover {
  color: #000;
}

#popupOk {
  margin-top: 15px;
  padding: 8px 16px;
  background: #007BFF;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

#popupOk:hover {
  background: #0056b3;
}

.custom-popup {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.popup-content {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  text-align: center;
  max-width: 400px;
  font-family: Arial, sans-serif;
}

.custom-popup.success .popup-content { border-left: 6px solid #4CAF50; }
.custom-popup.error .popup-content { border-left: 6px solid var(--orange); }
.custom-popup.info .popup-content { border-left: 6px solid var(--blue); }

.popup-content button {
  margin-top: 15px;
  padding: 8px 16px;
  border: none;
  background: #2196F3;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.popup-content button:hover {
  background: #1976D2;
}

@keyframes fadeInScale {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

#joinTeamForm .form-row {
  display: flex;
  gap: 1.5rem;
}
#joinTeamForm .form-row input.form-control[type="file"] {
  padding: 0.6rem 1rem;
  background: #f5f5f5;
  border-radius: 6px;
  border: none;
  font-size: 1rem;
  color: #333;
}
#joinTeamForm .form-row input.form-control[type="file"]::-webkit-file-upload-button {
  background: #eaeaea;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1.2rem;
  color: #333;
  font-weight: 500;
  cursor: pointer;
}
#joinTeamForm .form-row input.form-control[type="file"]::file-selector-button {
  background: #eaeaea;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1.2rem;
  color: #333;
  font-weight: 500;
  cursor: pointer;
}
#joinTeamForm .form-row {
  width: 100%;
}
#joinTeamForm .form-row input.form-control {
  flex: 1 1 0;
}
#joinTeamForm .form-row:last-child {
  flex-direction: column;
  gap: 0;
}

.roles-sec {
  display: flex;
  flex-direction: column;
  margin-top: 2rem;
  gap: 2rem;
  p {
    font-size: 25px;
    text-align: center;
    color: var(--orange);
    font-weight: bold;
  }
}

.role-wrapper {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 2rem;
}

.role {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  outline: 10px solid white;
  border-radius: 15px;
  gap: 1rem;
  box-shadow: 0px 0px 40px rgba(0, 0, 0, 0.119), 0 1.5px 6px rgba(0, 0, 0, 0.152);
  h2 {
    font-size: 30px;
    font-weight: bold;
    color: var(--blue);
  }
  a {
    color: var(--orange);
  }
  a:hover {
    font-weight: bold;
    text-decoration: underline;
  }
}

@media (max-width: 776px) {

  body {
    overflow-y: scroll;
    overflow-x: hidden;
  }

  .form-card {
    margin: 4rem 1rem 2rem;
  }

  .contactus-container {
    flex-direction: column;
    gap: 2rem;
    align-items: stretch;
  }
  .sidebar {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
  }
  .sidebar-btn {
    width: 50%;
    min-width: 140px;
    padding: 0.8rem 0;
  }
  .form-card, .form-card.expanded {
    width: 90vw;
  }

  #joinTeamForm { 
    gap: 2.2rem !important; 
  }
  #joinTeamForm .form-row {
    flex-direction: column;
    gap: 2rem;
  }
  .sidebar-highlight {
    border-radius: 2rem;
    height: 100%;
  }

  .roles-sec {
    p {
      font-size: 20px;
    }
  }

  .role-wrapper {
    flex-wrap: wrap;
  }

  .role {
    padding: 1rem;
    gap: 0.5rem;
    h2 {
      font-size: 20px;
    }
  }
}