@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f9f9f9;
}

.container {
  width: 90%;
  max-width: 800px;
  margin: 20px auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
}

h4 {
  text-align: center;
  font-size: 1em;
  margin-bottom: 20px;
  position: relative;
}

h4 img {
  width: 80px;  
  height: auto;
  vertical-align: middle;  
  margin-left: 10px;  
}

.school-logo {
    width: 100px;
    height: auto;
    display: block;
    margin: 15px auto;
    object-fit: contain;
}

fieldset {
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 20px;
  padding: 15px;
}

legend {
  font-weight: bold;
  font-size: 1.1em;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
}

input, select {
  width: 100%;
  padding: 8px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

button {
  padding: 10px 20px;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

button:hover {
  background-color: #0056b3;
}

p {
  text-align: center;
  font-size: 0.9em;
  margin-top: 10px;
}

hr {
  border: 1px solid #ccc;
  margin: 20px 0;
}

#submitButton {
    background-color: #f3ff74;
    color: #000000;
    padding: 15px 30px;
    margin: 20px 0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    width: 100%;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#submitButton:hover {
    background-color: #ffff8d;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

#submitButton:active {
    background-color: #f3ff74;
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Error styles */
.input-error {
    border-color: #ff0000 !important;
    background-color: #fff8f8;
    margin-bottom: 4px;
}

.error-message {
    color: #ff0000;
    font-size: 12px;
    display: none;
     margin-bottom: 10px;
    padding-left: 2px; 
    transition: all 0.3s ease;
}

.error-message.visible {
    display: block;
}

/* Input states */
input:not(.input-error):focus,
select:not(.input-error):focus {
     box-shadow: 0 0 0 2px #c7c7c733;
}

input:read-only {
    background-color: #f0f0f0;
    cursor: not-allowed;
}

.back-link {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff;
    color: #1e293b;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    z-index: 100;
}

.back-link:hover {
    background: #ffd700;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Semester toggle buttons above subjects list */
.semester-toggle-wrapper {
  margin: 10px 0 16px 0;
  text-align: center;
}

.semester-toggle {
  display: inline-flex;
  gap: 8px;
  background: #fff;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid #e6e6e6;
}

.semester-btn {
  padding: 8px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  color: #1e293b;
}

.semester-btn:hover {
  background: #f1f5f9;
}

.semester-btn.active {
  background: #ffd700;
  color: #000;
  box-shadow: 0 4px 10px rgba(255, 215, 0, 0.18);
}

.student-type-selection {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.student-type-selection div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.student-type-selection input[type="radio"] {
    accent-color: #ffd700;
}

.helper-text {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
}

#studentIdField {
    position: relative;
}

.student-type-container {
    margin-bottom: 1rem;
    text-align: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.student-type-container h3 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.student-type-options {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 0.5rem 0;
}

.student-type-card {
    position: relative;
    cursor: pointer;
    width: 140px;
}

.student-type-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.card-content {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-align: center;
    transition: all 0.2s ease;
}

.card-content i {
    font-size: 18px;
    color: #64748b;
    margin-bottom: 4px;
}

.card-content span {
    font-size: 0.8rem;
    color: #1e293b;
    font-weight: 500;
}

.student-type-card input[type="radio"]:checked + .card-content {
    border-color: #ffd700;
    background: #fffbeb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.15);
}

.student-type-card:hover .card-content {
    border-color: #ffd700;
}

.student-id-field {
    position: relative;
    margin-bottom: 1rem;
}

.student-id-field input[readonly] {
    background-color: #f0f0f0;
    cursor: not-allowed;
}

.helper-text {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
    display: block;
}

@media (max-width: 768px) {
    .back-link {
        top: 12px;
        left: 12px;
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media print {
  body, .container {
    background: none;
    box-shadow: none;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  h4 {
    font-size: 1em;
    text-align: center;
  }

  ul {
    padding-left: 20px;
  }

  button, #downloadButton {
    display: none;
  }
}
