/* =========================================
   2209 Proje Başvuruları Bilgi Toplama Portalı
   ========================================= */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #1a1a2e;
  background-color: #f0f2f5;
  min-height: 100vh;
}

/* --- Visually Hidden (Accessibility) --- */
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  padding-inline: 1rem;
}

/* --- Header --- */
.site-header {
  background: linear-gradient(135deg, #1a1a5e 0%, #2d2d7f 100%);
  color: #fff;
  padding: 1.5rem 0;
  margin-block-end: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.site-header h1 {
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.01em;
}

/* --- Required Note --- */
.required-note {
  font-size: 0.875rem;
  color: #555;
  margin-block-end: 1.25rem;
}

.required-note span {
  color: #d93025;
  font-weight: 700;
}

/* --- Fieldsets --- */
fieldset {
  border: none;
  padding: 0;
}

.advisor-section {
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  margin-block-end: 1.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.advisor-section > legend {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1a5e;
  margin-block-end: 1rem;
  padding-block-end: 0.5rem;
  border-block-end: 2px solid #e0e0e0;
  width: 100%;
  display: block;
  float: left;
}

/* --- Field --- */
.field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  margin-block-end: 1.25rem;
}

label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #333;
  display: inline-block;
  padding: 4px 0;
  margin: -4px 0;
}

label span[aria-hidden="true"] {
  color: #d93025;
  margin-inline-start: 2px;
}

input[type="text"],
input[type="number"],
select {
  font: inherit;
  font-size: max(1rem, 1em);
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 2px solid #c4c4c4;
  border-radius: 6px;
  background: #fff;
  color: #1a1a2e;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 48px;
}

@media (pointer: coarse) {
  input[type="text"],
  input[type="number"],
  select {
    min-height: 52px;
  }
}

input::placeholder {
  color: #999;
}

input:focus-visible,
select:focus-visible {
  outline: 3px solid #3b5fe0;
  outline-offset: 2px;
  border-color: #3b5fe0;
}

/* --- Validation Styling (after interaction) --- */
:is(:user-invalid, .user-invalid-fallback) {
  border-color: #d93025 !important;
  background-color: #fef2f1 !important;
}

:is(:user-valid, .user-valid-fallback) {
  border-color: #188038;
}

/* Custom JS validation errors */
.has-error input,
.has-error select {
  border-color: #d93025 !important;
  background-color: #fef2f1 !important;
}

.has-error > .error-msg {
  display: block !important;
}

/* --- Error Message --- */
.error-msg {
  display: none;
  color: #d93025;
  font-size: 0.8125rem;
  margin-block-start: 0.2rem;
  font-weight: 500;
}

/* --- Hint Text --- */
.hint {
  display: block;
  color: #777;
  font-size: 0.8125rem;
}

/* --- Input with Suffix (₺, Ay) --- */
.input-suffix {
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
}

.input-suffix input {
  flex: 1;
  border-start-end-radius: 0;
  border-end-end-radius: 0;
  border-inline-end: none;
}

.input-suffix .suffix {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  background: #eef1f5;
  border: 2px solid #c4c4c4;
  border-inline-start: none;
  border-start-end-radius: 6px;
  border-end-end-radius: 6px;
  font-weight: 600;
  color: #555;
  min-height: 48px;
  font-size: 0.9375rem;
  white-space: nowrap;
}

@media (pointer: coarse) {
  .input-suffix .suffix {
    min-height: 52px;
  }
}

/* When parent field has error, style the suffix border too */
.has-error .input-suffix .suffix {
  border-color: #d93025;
}

/* --- Radio Group --- */
.radio-group {
  display: flex;
  gap: 1.5rem;
  margin-block: 0.5rem;
}

.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-weight: 500;
  padding: 6px 0;
  margin: -6px 0;
}

.radio-label input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: #1a1a5e;
  cursor: pointer;
}

/* --- Project Card --- */
.project-card {
  background: #fff;
  border-radius: 10px;
  margin-block-end: 1.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  border: 2px solid transparent;
  transition: border-color 0.2s ease;
  overflow: hidden;
}

.project-card-header {
  display: flex;
  width: 100%;
  padding: 0;
  float: left;
}

.btn-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.5rem;
  background: #f7f8fc;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a5e;
  text-align: start;
  border-block-end: 2px solid #e0e0e0;
  transition: background-color 0.15s ease;
}

.btn-toggle:hover {
  background: #eef0f8;
}

.btn-toggle:focus-visible {
  outline: 3px solid #3b5fe0;
  outline-offset: -3px;
}

.toggle-icon {
  font-size: 1.25rem;
  transition: transform 0.2s ease;
}

.btn-toggle[aria-expanded="false"] .toggle-icon {
  transform: rotate(-90deg);
}

.project-card-body {
  padding: 1.5rem;
}

.project-card-body[hidden] {
  display: none;
}

/* --- Students Section --- */
.students-section {
  margin-block-start: 1.5rem;
  padding-block-start: 1.25rem;
  border-block-start: 1px solid #e8e8e8;
}

.students-section > legend {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a5e;
  margin-block-end: 0.5rem;
}

.question-text {
  font-weight: 500;
  margin-block-end: 0.25rem;
  color: #333;
}

.question-text span {
  color: #d93025;
}

/* --- Student Card --- */
.student-card {
  background: #f8f9fb;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1.25rem;
  margin-block-end: 1rem;
  position: relative;
}

.student-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #444;
  margin-block-end: 1rem;
  padding-block-end: 0.5rem;
  border-block-end: 1px solid #e0e0e0;
}

/* --- Buttons --- */
.btn {
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  min-height: 48px;
}

@media (pointer: coarse) {
  .btn {
    min-height: 52px;
  }
}

.btn:focus-visible {
  outline: 3px solid #3b5fe0;
  outline-offset: 2px;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: #1a1a5e;
  color: #fff;
}

.btn-primary:hover {
  background: #2a2a7e;
}

.btn-secondary {
  background: #fff;
  color: #1a1a5e;
  border-color: #1a1a5e;
}

.btn-secondary:hover {
  background: #f0f0ff;
}

.btn-add {
  background: #e8f5e9;
  color: #1b5e20;
  border-color: #a5d6a7;
}

.btn-add:hover {
  background: #c8e6c9;
}

.btn-danger {
  background: #fff;
  color: #c62828;
  border-color: #ef9a9a;
}

.btn-danger:hover {
  background: #ffebee;
}

.btn-sm {
  font-size: 0.8125rem;
  padding: 0.4rem 0.9rem;
  min-height: 40px;
}

/* --- Form Actions --- */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block-start: 1rem;
  padding-block-start: 1rem;
}

.summary-actions {
  justify-content: center;
  margin-block-start: 2rem;
}

/* --- Summary Screen --- */
#summary-screen h2 {
  font-size: 1.35rem;
  color: #1a1a5e;
  margin-block-end: 1.5rem;
  text-align: center;
}

.summary-section {
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  margin-block-end: 1.25rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.summary-section h3 {
  font-size: 1.05rem;
  color: #1a1a5e;
  margin-block-end: 1rem;
  padding-block-end: 0.5rem;
  border-block-end: 2px solid #e0e0e0;
}

.summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  padding: 0.5rem 0;
  border-block-end: 1px solid #f0f0f0;
}

.summary-row:last-child {
  border-block-end: none;
}

.summary-label {
  font-weight: 600;
  color: #555;
  min-width: 200px;
  flex-shrink: 0;
}

.summary-value {
  color: #1a1a2e;
  flex: 1;
}

.summary-students {
  margin-block-start: 0.75rem;
  padding-inline-start: 0;
}

.summary-student-card {
  background: #f8f9fb;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-block-end: 0.5rem;
  border: 1px solid #e8e8e8;
}

.summary-student-card h5 {
  font-size: 0.875rem;
  color: #666;
  margin-block-end: 0.5rem;
}

/* --- Success Screen --- */
.success-box {
  text-align: center;
  background: #fff;
  border-radius: 12px;
  padding: 3rem 2rem;
  margin-block-start: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.success-icon {
  width: 72px;
  height: 72px;
  line-height: 72px;
  font-size: 2.5rem;
  color: #fff;
  background: #2e7d32;
  border-radius: 50%;
  margin-inline: auto;
  margin-block-end: 1.5rem;
}

.success-box h2 {
  font-size: 1.5rem;
  color: #2e7d32;
  margin-block-end: 0.75rem;
}

.success-box p {
  font-size: 1.0625rem;
  color: #444;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .container {
    padding-inline: 0.75rem;
  }

  .advisor-section,
  .project-card-body,
  .summary-section {
    padding: 1rem;
  }

  .btn-toggle {
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .summary-label {
    min-width: unset;
    width: 100%;
  }

  .student-card {
    padding: 1rem;
  }
}

/* Number input: hide spinners for cleaner UI */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* Disabled select styling */
select:disabled {
  background-color: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

/* Smooth body padding for bottom on mobile */
main {
  padding-block-end: 3rem;
}
