@import url('style.css');

/* Form-specific overrides */
.form-page {
  min-height: 100svh;
  background: var(--navy-dark);
  padding: 1.25rem 0 3rem;
}

.form-header {
  text-align: center;
  padding: 1rem 0 2rem;
}

.form-header .form-logo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  margin: 0 auto 1rem;
  box-shadow: 0 0 30px rgba(201, 162, 39, 0.25);
}

.form-header h1 {
  font-family: var(--font-display);
  color: var(--cream);
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

.form-header .form-title-gold {
  color: var(--gold-light);
}

.form-subtitle {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.form-header p {
  color: var(--cream-muted);
  font-size: 0.9rem;
  max-width: 420px;
  margin: 0 auto;
}

.form-card {
  background: linear-gradient(160deg, var(--navy-light), var(--navy));
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  max-width: 520px;
  margin: 0 auto;
}

.form-section-title {
  font-family: var(--font-display);
  color: var(--gold-light);
  font-size: 0.95rem;
  margin: 0 0 0.35rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
}

.form-section {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(201, 162, 39, 0.18);
}

.form-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.form-section-intro {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--cream-muted);
}

.form-section .form-group:last-child {
  margin-bottom: 0;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 0.4rem;
  letter-spacing: 0.03em;
}

.form-group label .optional {
  color: var(--cream-muted);
  font-weight: 400;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: var(--radius);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.form-group input[type="text"]::placeholder,
.form-group input[type="number"]::placeholder,
.form-group input[type="tel"]::placeholder,
.form-group input[type="url"]::placeholder,
.form-group textarea::placeholder {
  color: rgba(200, 192, 170, 0.55);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.char-count {
  text-align: right;
  font-size: 0.72rem;
  color: var(--cream-muted);
  margin-top: 0.25rem;
}

.char-count.warn { color: #e8a317; }
.char-count.over { color: var(--red); }

/* Profile pic upload — WhatsApp-style avatar */
.form-group-pic {
  text-align: center;
}

.form-group-pic > label {
  display: block;
  text-align: center;
}

.pic-upload {
  width: 100%;
  display: flex;
  justify-content: center;
}

.pic-input-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.pic-avatar-wrap {
  position: relative;
  display: inline-block;
  cursor: pointer;
  padding-bottom: 0.75rem;
}

.pic-preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid rgba(201, 162, 39, 0.45);
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.pic-avatar-wrap:hover .pic-preview {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(201, 162, 39, 0.25);
}

.pic-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pic-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: var(--cream-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  padding: 0.5rem;
}

.pic-placeholder-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.pic-edit-badge {
  display: none;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  gap: 0.3rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--navy-dark);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  border: 2px solid var(--navy-dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.pic-avatar-wrap.has-photo .pic-edit-badge {
  display: inline-flex;
}

.pic-edit-badge::before {
  content: '✎';
  font-size: 0.8rem;
  line-height: 1;
}

.pic-avatar-wrap.has-photo .pic-preview {
  border-color: var(--gold);
}

@media (min-width: 480px) {
  .pic-preview {
    width: 130px;
    height: 130px;
  }
}

/* Awards — dynamic list */
.field-hint {
  margin: -0.25rem 0 0.65rem;
  font-size: 0.78rem;
  color: rgba(200, 192, 170, 0.7);
}

.cricket-photos-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cricket-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.cricket-photo-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(201, 162, 39, 0.25);
  background: rgba(0, 0, 0, 0.35);
}

.cricket-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cricket-photo-remove {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.btn-add-photos {
  align-self: flex-start;
  padding: 0.65rem 1rem;
  background: transparent;
  border: 1px dashed rgba(201, 162, 39, 0.45);
  border-radius: var(--radius);
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 0.88rem;
  cursor: pointer;
}

.btn-add-photos:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.photo-count {
  font-size: 0.78rem;
  color: rgba(200, 192, 170, 0.75);
}

@media (min-width: 480px) {
  .cricket-photos-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cricket-videos-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cricket-videos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.cricket-video-item {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(201, 162, 39, 0.25);
  background: rgba(0, 0, 0, 0.45);
}

.cricket-video-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.cricket-video-label {
  position: absolute;
  left: 0.35rem;
  bottom: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: var(--cream);
  font-size: 0.68rem;
}

.cricket-video-remove {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.btn-add-videos {
  align-self: flex-start;
  padding: 0.65rem 1rem;
  background: transparent;
  border: 1px dashed rgba(201, 162, 39, 0.45);
  border-radius: var(--radius);
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 0.88rem;
  cursor: pointer;
}

.btn-add-videos:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (min-width: 480px) {
  .cricket-videos-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.awards-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.award-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.award-row input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: var(--radius);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.award-row input:focus {
  outline: none;
  border-color: var(--gold);
}

.award-row input::placeholder {
  color: rgba(200, 192, 170, 0.55);
}

.award-remove {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(196, 30, 58, 0.4);
  background: rgba(196, 30, 58, 0.12);
  color: #f08090;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.award-remove:hover {
  background: rgba(196, 30, 58, 0.22);
  border-color: rgba(196, 30, 58, 0.6);
}

.btn-add-award {
  width: 100%;
  padding: 0.7rem 1rem;
  background: rgba(201, 162, 39, 0.08);
  border: 1.5px dashed rgba(201, 162, 39, 0.35);
  border-radius: var(--radius);
  color: var(--gold-light);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-add-award:hover {
  background: rgba(201, 162, 39, 0.15);
  border-color: var(--gold);
}

.awards-empty {
  font-size: 0.8rem;
  color: var(--cream-muted);
  text-align: center;
  padding: 0.5rem;
  font-style: italic;
}

/* Role cards — compact, 2 per row on mobile */
.role-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
}

.role-grid .role-card {
  min-width: 0;
}

.role-grid .role-card-box {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.45rem 0.3rem;
  min-height: 68px;
  text-align: center;
  position: relative;
  border-width: 1px;
  border-radius: 10px;
}

.role-grid .role-icon {
  font-size: 0.95rem;
  width: auto;
  line-height: 1;
}

.role-grid .role-label {
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.15;
}

.role-grid .role-tick {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 15px;
  height: 15px;
  font-size: 0.5rem;
  border-width: 1.5px;
}

.role-grid .role-card:hover .role-card-box {
  transform: none;
}

.role-grid .role-card:has(.role-check:checked) .role-card-box {
  transform: none;
}

/* Fielding positions — compact chips, 3 per row on mobile */
.fielding-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.field-chip {
  cursor: pointer;
  display: block;
}

.field-check {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.field-chip-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.35rem 0.25rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(201, 162, 39, 0.18);
  border-radius: 8px;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--cream-muted);
  text-align: center;
  line-height: 1.2;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.field-chip:hover .field-chip-box {
  border-color: rgba(201, 162, 39, 0.4);
  background: rgba(201, 162, 39, 0.06);
}

.field-chip:has(.field-check:checked) .field-chip-box {
  border-color: var(--gold);
  background: rgba(201, 162, 39, 0.15);
  color: var(--gold-light);
  box-shadow: 0 0 10px rgba(201, 162, 39, 0.12);
}

@media (min-width: 480px) {
  .role-grid .role-label {
    font-size: 0.72rem;
  }

  .role-grid .role-card-box {
    min-height: 78px;
    padding: 0.55rem 0.4rem;
  }

  .fielding-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.45rem;
  }

  .field-chip-box {
    font-size: 0.68rem;
    min-height: 42px;
  }
}

@media (min-width: 600px) {
  .fielding-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Role cards — stylish checkboxes */
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.role-card {
  cursor: pointer;
  display: block;
}

.role-check {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.role-card-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1.5px solid rgba(201, 162, 39, 0.2);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s, transform 0.2s;
  position: relative;
}

.role-card:hover .role-card-box {
  border-color: rgba(201, 162, 39, 0.45);
  background: rgba(201, 162, 39, 0.06);
}

.role-card:has(.role-check:checked) .role-card-box {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.18), rgba(201, 162, 39, 0.06));
  box-shadow: 0 0 20px rgba(201, 162, 39, 0.15), inset 0 0 0 1px rgba(201, 162, 39, 0.1);
  transform: translateY(-1px);
}

.role-icon {
  font-size: 1.35rem;
  width: 2rem;
  text-align: center;
  flex-shrink: 0;
}

.role-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--cream);
  flex: 1;
  line-height: 1.3;
}

.role-card:has(.role-check:checked) .role-label {
  color: var(--gold-light);
}

.role-tick {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(201, 162, 39, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: transparent;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.role-card:has(.role-check:checked) .role-tick {
  background: var(--gold);
  border-color: var(--gold-light);
  color: var(--navy-dark);
}

.form-submit {
  width: 100%;
  margin-top: 1.5rem;
}

.form-message {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  text-align: center;
  display: none;
}

.form-message.success {
  display: block;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.35);
  color: #6ee7a0;
}

.form-message.error {
  display: block;
  background: rgba(196, 30, 58, 0.12);
  border: 1px solid rgba(196, 30, 58, 0.35);
  color: #f08090;
}

.form-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--gold);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.form-back:hover { color: var(--gold-light); }

@media (min-width: 600px) {
  .form-header h1 { font-size: 1.75rem; }
  .form-card { padding: 2rem; }
}
