*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #1a3a5c;
  --primary-light: #2a5a8c;
  --accent: #c8102e;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --border: #d1d5db;
  --text: #1f2937;
  --text-light: #6b7280;
  --error: #dc2626;
  --success: #16a34a;
  --radius: 8px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* Header */
.header {
  text-align: center;
  padding: 32px 24px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
}

.university-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border: 3px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.header h2 {
  font-size: 1rem;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 16px;
}

.header-desc {
  font-size: 0.875rem;
  line-height: 1.7;
  opacity: 0.85;
  max-width: 640px;
  margin: 0 auto 8px;
}

.header-sub {
  font-size: 0.875rem;
  font-style: italic;
  opacity: 0.75;
}

/* Landing Page */
.landing-view {
  background: var(--card-bg);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 48px 32px;
}

.landing-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 700px;
  margin: 0 auto;
}

.landing-card {
  background: #f8f9fb;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.landing-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(26, 58, 92, 0.12);
  transform: translateY(-2px);
}

.landing-card-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.landing-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.landing-card p {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 16px;
}

.landing-card-btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s;
}

.landing-card:hover .landing-card-btn {
  background: var(--primary-light);
}

/* View sections */
.view-section {
  /* wrapper for form and tracking views */
}

.view-back {
  background: var(--card-bg);
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px solid var(--border);
  padding: 8px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-back:hover {
  background: #f0f4f8;
  border-color: var(--primary-light);
}

.btn-back-home {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 28px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-back-home:hover {
  background: var(--primary-light);
}

/* Tracking Full Section */
.tracking-section-full {
  background: var(--card-bg);
  padding: 32px;
  border-radius: 0 0 var(--radius) var(--radius);
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.section-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 20px;
}

/* Form */
form {
  background: var(--card-bg);
  padding: 0;
}

fieldset {
  border: none;
  padding: 32px 32px 24px;
  border-bottom: 1px solid var(--border);
  margin-top: 8px;
}

fieldset:last-of-type {
  border-bottom: none;
}

legend {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  width: 100%;
  display: block;
}

.form-group {
  margin-bottom: 18px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group > label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text);
}

.required {
  color: var(--accent);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.1);
}

input.invalid, textarea.invalid {
  border-color: var(--error);
}

input.invalid:focus, textarea.invalid:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Radio groups */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.radio-group.vertical {
  flex-direction: column;
  gap: 8px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.radio-label:hover {
  border-color: var(--primary-light);
  background: rgba(26, 58, 92, 0.03);
}

.radio-label:has(input:checked) {
  border-color: var(--primary);
  background: rgba(26, 58, 92, 0.06);
}

.radio-label input[type="radio"] {
  accent-color: var(--primary);
}

.radio-label.disabled-option {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f3f3f3;
}

.option-note {
  font-size: 0.8rem;
  color: var(--text-light);
  font-weight: 400;
}

.diger-input {
  margin-top: 8px;
}

.diger-input.hidden {
  display: none;
}

/* Checkbox */
.checkbox-group {
  margin-bottom: 16px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1.6;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 4px;
  flex-shrink: 0;
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}

.checkbox-text {
  color: var(--text-light);
}

/* File upload - auto numbering */
.ekler-fieldset {
  counter-reset: ekler-counter;
}

.ekler-fieldset .file-group:not(.hidden) {
  counter-increment: ekler-counter;
}

.ekler-fieldset .file-group:not(.hidden) > label::before {
  content: counter(ekler-counter) ") ";
  font-weight: 600;
}

.dilekce-download {
  display: inline-block;
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 10px;
  transition: background 0.2s;
}

.dilekce-download:hover {
  background: var(--primary-light);
}

.file-group label {
  margin-bottom: 4px;
}

.file-note {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 2px;
}

.file-input-wrapper {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
  overflow: hidden;
}

.file-input-wrapper:hover {
  border-color: var(--primary-light);
}

.file-input-wrapper.dragover {
  border-color: var(--primary);
  background: rgba(26, 58, 92, 0.04);
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
  pointer-events: none;
}

.file-placeholder .file-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.file-placeholder small {
  font-size: 0.75rem;
  margin-top: 4px;
  opacity: 0.7;
}

.file-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(26, 58, 92, 0.04);
}

.file-selected .file-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--primary);
}

.file-remove {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 3;
  position: relative;
}

.file-remove:hover {
  color: var(--error);
  background: rgba(220, 38, 38, 0.1);
}

.hidden {
  display: none !important;
}

/* Error messages */
.error-msg {
  display: block;
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 4px;
  min-height: 0;
}

/* Captcha */
.captcha-section {
  background: rgba(26, 58, 92, 0.03);
}

.captcha-section label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
}

.captcha-section input[type="number"] {
  max-width: 200px;
}

/* Honeypot */
.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

/* Submit */
.form-actions {
  padding: 24px 32px 32px;
  background: var(--card-bg);
  border-radius: 0 0 var(--radius) var(--radius);
}

.btn-submit {
  display: block;
  width: 100%;
  padding: 14px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-submit:hover {
  background: var(--primary-light);
}

.btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Success */
.success-message {
  text-align: center;
  padding: 48px 32px;
  background: var(--card-bg);
  border-radius: 0 0 var(--radius) var(--radius);
}

.success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.success-message h2 {
  color: var(--success);
  margin-bottom: 12px;
}

.success-message p {
  color: var(--text-light);
  margin-bottom: 6px;
}

/* Tracking Section */

.tracking-input-group {
  display: flex;
  gap: 10px;
}

.tracking-input-group input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
}

.tracking-input-group input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.1);
}

.btn-tracking-search {
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-tracking-search:hover {
  background: var(--primary-light);
}

.tracking-result {
  margin-top: 16px;
}

.tracking-card {
  background: #f8f9fb;
  border-radius: var(--radius);
  padding: 16px 20px;
  border: 1px solid var(--border);
}

.tracking-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
}

.tracking-info:last-child {
  border-bottom: none;
}

.tracking-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-light);
  min-width: 130px;
}

.tracking-value {
  font-size: 0.9rem;
  color: var(--text);
}

.tracking-aciklama {
  background: #fff;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-style: italic;
  flex: 1;
}

.tracking-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-beklemede {
  background: #fef3cd;
  color: #856404;
}

.status-onaylandi {
  background: #d1fae5;
  color: #065f46;
}

.status-reddedildi {
  background: #fee2e2;
  color: #991b1b;
}

.status-duzeltme {
  background: #ffedd5;
  color: #9a3412;
}

.status-duzeltildi {
  background: #dbeafe;
  color: #1e40af;
}

.tracking-error {
  color: var(--error);
  font-size: 0.85rem;
  padding: 10px 14px;
  background: #fef2f2;
  border-radius: var(--radius);
}

.tracking-loading {
  color: var(--text-light);
  font-size: 0.85rem;
  padding: 10px 14px;
}

/* Tracking Upload */
.tracking-upload {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.tracking-upload-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 10px;
}

.tracking-upload-area {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
  overflow: hidden;
}

.tracking-upload-area:hover {
  border-color: var(--primary-light);
}

.tracking-upload-area.dragover {
  border-color: var(--primary);
  background: rgba(26, 58, 92, 0.04);
}

.tracking-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.tracking-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
  pointer-events: none;
}

.tracking-upload-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.tracking-upload-placeholder small {
  font-size: 0.75rem;
  margin-top: 4px;
  opacity: 0.7;
}

.tracking-file-list {
  margin-top: 10px;
}

.tracking-file-item {
  font-size: 0.85rem;
  padding: 6px 10px;
  background: #f0f4f8;
  border-radius: var(--radius);
  margin-bottom: 4px;
  color: var(--text);
}

.tracking-file-item.error {
  background: #fef2f2;
  color: var(--error);
}

.btn-tracking-upload {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-tracking-upload:hover {
  background: var(--primary-light);
}

.btn-tracking-upload:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tracking-upload-msg {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
}

.tracking-upload-msg.success {
  background: #d1fae5;
  color: #065f46;
}

.tracking-upload-msg.error {
  background: #fee2e2;
  color: #991b1b;
}

.tracking-ek-dosyalar {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.tracking-ek-item {
  font-size: 0.85rem;
  padding: 6px 10px;
  background: #f0f4f8;
  border-radius: var(--radius);
  margin-bottom: 4px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tracking-ek-tarih {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 12px 8px 32px;
  }

  .landing-view {
    padding: 24px 16px;
  }

  .landing-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .landing-card {
    padding: 24px 20px;
  }

  .tracking-section-full {
    padding: 20px 16px;
  }

  fieldset {
    padding: 20px 16px;
  }

  .form-actions {
    padding: 20px 16px 24px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .header {
    padding: 24px 16px;
  }

  .header h1 {
    font-size: 1.2rem;
  }

  .radio-group {
    flex-direction: column;
    gap: 8px;
  }

  .tracking-input-group {
    flex-direction: column;
  }

  .tracking-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .tracking-label {
    min-width: unset;
  }
}
