/* Global Page Style */
body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #c9e7ff, #fdfbfb);
  margin: 0;
  padding: 0;
  position: relative;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

.form-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 15px;
  box-sizing: border-box;
}

/* Decorative Stationery Shapes */
body::before, body::after {
  content: "";
  position: absolute;
  width: 350px;
  height: 350px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  filter: blur(60px);
  z-index: -1;
}

body::before {
  top: -80px;
  left: -80px;
  background: #a8d8ff;
}

body::after {
  bottom: -80px;
  right: -80px;
  background: #ffd6e8;
}

/* Header */
.container {
  text-align: center;
  padding: 30px 15px 20px;
  width: 100%;
  box-sizing: border-box;
}

.container h1 {
  font-size: 32px;
  font-weight: 800;
  color: #2a2a2a;
  letter-spacing: 1px;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.1);
  margin: 0 0 10px;
  line-height: 1.2;
}

.container img {
  width: 130px;
  margin-top: 10px;
  border-radius: 18px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
  animation: floatLogo 4s ease-in-out infinite, glowPulse 3s ease-in-out infinite;
  transition: 0.4s ease;
  max-width: 100%;
  height: auto;
}

/* Floating animation */
@keyframes floatLogo {
  0% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}

/* Glow pulse animation */
@keyframes glowPulse {
  0% { filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2)); }
  50% { filter: drop-shadow(0 6px 14px rgba(0,150,255,0.4)); }
  100% { filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2)); }
}

/* Hover effect */
.container img:hover {
  transform: translateY(-10px) scale(1.08);
  filter: drop-shadow(0 10px 20px rgba(0,150,255,0.45));
}

/* Form Card */
form {
  width: 90%;
  max-width: 600px;
  margin: 20px auto 40px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  padding: 30px;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  animation: fadeIn 0.6s ease-in-out;
  border: 1px solid rgba(255,255,255,0.4);
  box-sizing: border-box;
}

.form-container h2 {
  text-align: center;
  color: #2a2a2a;
  font-size: 24px;
  margin-top: 10px;
}

/* Fade Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(25px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Labels */
label {
  display: block;
  margin-top: 20px;
  font-weight: 600;
  color: #333;
  font-size: 15px;
}

/* Inputs */
input, select, textarea {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  border-radius: 12px;
  border: 1px solid #ccc;
  background: #fdfdfd;
  transition: 0.3s ease;
  font-size: 15px;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

input:focus, select:focus, textarea:focus {
  border-color: #4CAF50;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
  outline: none;
}

/* ============================================ */
/* CUSTOM DATE PICKER - DOB FIELD               */
/* ============================================ */

.dob-wrapper {
  position: relative;
  margin-top: 6px;
}

#dob {
  width: 100%;
  padding: 12px 44px 12px 14px;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
  background: linear-gradient(135deg, #f8fafc, #ffffff);
  font-size: 15px;
  font-weight: 500;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.8);
  min-height: 48px;
  box-sizing: border-box;
}

#dob:hover {
  border-color: #90cdf4;
  box-shadow: 0 4px 16px rgba(33, 150, 243, 0.1), inset 0 1px 0 rgba(255,255,255,0.8);
  transform: translateY(-1px);
}

#dob:focus {
  border-color: #4CAF50;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.15), 0 8px 24px rgba(76, 175, 80, 0.1);
  transform: translateY(-2px);
  outline: none;
}

#dob.has-value {
  color: #1e293b;
  font-weight: 600;
  background: linear-gradient(135deg, #f0fdf4, #ffffff);
  border-color: #bbf7d0;
}

.dob-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  pointer-events: none;
  opacity: 0.7;
  transition: all 0.3s ease;
  z-index: 2;
}

.dob-wrapper:focus-within .dob-icon {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

/* Custom Calendar Popup */
.custom-calendar {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  max-width: 340px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0,0,0,0.03);
  padding: 16px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.96);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.custom-calendar.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Calendar Header */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 4px;
}

.cal-nav {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #f0fdf4, #e8f5e9);
  color: #1b5e20;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
  flex-shrink: 0;
}

.cal-nav:hover {
  background: linear-gradient(135deg, #4CAF50, #2f8f3a);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.3);
}

.cal-nav:active {
  transform: scale(0.95);
}

/* Title with Month/Year Select */
.cal-title {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

/* Month/Year Select Wrapper */
.cal-select-wrapper {
  position: relative;
}

.cal-select-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #1b5e20;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cal-select-btn:hover {
  background: rgba(76, 175, 80, 0.1);
}

.cal-select-btn::after {
  content: '▾';
  font-size: 12px;
  color: #4CAF50;
  transition: transform 0.2s ease;
}

.cal-select-wrapper.open .cal-select-btn::after {
  transform: rotate(180deg);
}

.cal-select-wrapper.open .cal-select-btn {
  background: rgba(76, 175, 80, 0.15);
}

/* Dropdown */
.cal-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: white;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.03);
  padding: 8px;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 120px;
  max-height: 220px;
}

.cal-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
}

.cal-dropdown-scroll {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: #bbf7d0 transparent;
}

.cal-dropdown-scroll::-webkit-scrollbar {
  width: 4px;
}

.cal-dropdown-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.cal-dropdown-scroll::-webkit-scrollbar-thumb {
  background: #bbf7d0;
  border-radius: 4px;
}

/* Month/Year Option */
.cal-option {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  border: none;
  background: transparent;
  font-family: inherit;
  white-space: nowrap;
}

.cal-option:hover {
  background: linear-gradient(135deg, #f0fdf4, #e8f5e9);
  color: #1b5e20;
  transform: translateX(4px);
}

.cal-option.active {
  background: linear-gradient(135deg, #4CAF50, #2f8f3a);
  color: white;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.25);
}

/* Weekdays */
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
  padding: 0 2px;
}

.cal-weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 0;
}

/* Days Grid */
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 0 2px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  position: relative;
  background: transparent;
}

.cal-day:hover:not(.disabled):not(.selected) {
  background: linear-gradient(135deg, #f0fdf4, #e8f5e9);
  border-color: #bbf7d0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
  color: #1b5e20;
  font-weight: 600;
}

.cal-day.today {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  color: #1565c0;
  font-weight: 700;
  border-color: #90caf9;
}

.cal-day.today:hover:not(.selected) {
  background: linear-gradient(135deg, #2196F3, #1976D2);
  color: white;
  border-color: #1976D2;
}

.cal-day.selected {
  background: linear-gradient(135deg, #4CAF50, #2f8f3a);
  color: white;
  font-weight: 700;
  border-color: #2f8f3a;
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.35);
  transform: translateY(-2px);
}

.cal-day.selected::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: rgba(255,255,255,0.8);
  border-radius: 50%;
}

.cal-day.other-month {
  color: #cbd5e1;
  font-weight: 400;
}

.cal-day.other-month:hover:not(.disabled) {
  background: #f1f5f9;
  color: #94a3b8;
}

.cal-day.disabled {
  color: #e2e8f0;
  cursor: not-allowed;
  opacity: 0.5;
}

/* Footer Buttons */
.cal-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.cal-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.cal-clear {
  background: #f1f5f9;
  color: #64748b;
}

.cal-clear:hover {
  background: #fee2e2;
  color: #dc2626;
}

.cal-today {
  background: linear-gradient(135deg, #4CAF50, #2f8f3a);
  color: white;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.25);
}

.cal-today:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.35);
}

/* ============================================ */

/* Gender Row */
.gender-row {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.gender-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  background: #f1faff;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #d0eaff;
  transition: 0.3s ease;
  margin-top: 0;
  cursor: pointer;
  min-height: 44px;
}

.gender-option:hover {
  background: #dff3ff;
  transform: translateY(-2px);
}

.gender-option input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #4CAF50;
  margin: 0;
  flex-shrink: 0;
}

/* Subjects Box */
.subjects-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

.subject-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 10px;
  background: #fafafa;
  transition: 0.3s ease;
  margin-top: 0;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
}

.subject-option:hover {
  background: #f0f0f0;
  border-color: #4CAF50;
}

.subject-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #4CAF50;
  margin: 0;
  flex-shrink: 0;
}

/* Submit Button */
.submit-btn {
  margin-top: 30px;
  padding: 16px;
  width: 100%;
  background: linear-gradient(135deg, #4CAF50, #2f8f3a);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.3s ease;
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
  min-height: 48px;
}

.submit-btn:hover {
  background: linear-gradient(135deg, #2f8f3a, #4CAF50);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.25);
}

.submit-btn:active {
  transform: translateY(-1px);
}

/* Footer */
.footer {
  text-align: center;
  padding: 30px 15px;
  margin-top: 30px;
  color: #444;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
}

.footer-container {
  margin: 0;
}

.footer a {
  color: #4CAF50;
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  text-decoration: underline;
}

/* Utility */
* {
  box-sizing: border-box;
}

/* ============================================ */
/* RESPONSIVE DESIGN - MOBILE FIRST REFINEMENTS */
/* ============================================ */

/* Large Mobile / Small Tablet View */
@media (max-width: 768px) {
  .container h1 {
    font-size: 26px;
  }

  form {
    width: 95%;
    padding: 22px;
    margin: 15px auto 30px;
  }

  .form-container h2 {
    font-size: 20px;
  }

  input, select, textarea {
    font-size: 16px;
    padding: 12px;
  }

  #dob {
    font-size: 16px;
    padding: 12px 42px 12px 14px;
    min-height: 48px;
  }

  .custom-calendar {
    max-width: 100%;
    left: 0;
    right: 0;
    padding: 14px;
  }

  .cal-select-btn {
    font-size: 15px;
    padding: 5px 8px;
  }

  .cal-dropdown {
    min-width: 110px;
    max-height: 200px;
  }

  .cal-dropdown-scroll {
    max-height: 180px;
  }

  .cal-option {
    padding: 8px 12px;
    font-size: 13px;
  }

  .cal-title {
    gap: 2px;
  }

  .cal-nav {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  .cal-day {
    font-size: 13px;
  }

  .gender-row {
    gap: 10px;
  }

  .gender-option {
    padding: 10px 14px;
    font-size: 14px;
  }

  .subjects-box {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .subject-option {
    padding: 12px;
    font-size: 15px;
  }

  .submit-btn {
    font-size: 17px;
    padding: 14px;
  }
}

/* Small Mobile View */
@media (max-width: 480px) {
  body::before, body::after {
    width: 200px;
    height: 200px;
    filter: blur(40px);
  }

  .container {
    padding: 20px 10px 15px;
  }

  .container h1 {
    font-size: 22px;
    letter-spacing: 0.5px;
  }

  .container img {
    width: 100px;
  }

  .form-container h2 {
    font-size: 18px;
  }

  form {
    width: 96%;
    padding: 18px 15px;
    border-radius: 14px;
  }

  label {
    font-size: 14px;
    margin-top: 16px;
  }

  input, select, textarea {
    font-size: 16px;
    padding: 12px;
    border-radius: 10px;
    margin-top: 4px;
  }

  #dob {
    font-size: 16px;
    padding: 12px 40px 12px 12px;
    border-radius: 12px;
  }

  .dob-icon {
    font-size: 18px;
    right: 12px;
  }

  .custom-calendar {
    padding: 12px;
    border-radius: 14px;
    top: calc(100% + 6px);
  }

  .cal-header {
    margin-bottom: 12px;
    padding: 0 2px;
  }

  .cal-nav {
    width: 32px;
    height: 32px;
    font-size: 15px;
    border-radius: 8px;
  }

  .cal-select-btn {
    font-size: 14px;
    padding: 5px 7px;
    border-radius: 6px;
  }

  .cal-dropdown {
    min-width: 100px;
    max-height: 180px;
    padding: 6px;
    border-radius: 12px;
  }

  .cal-dropdown-scroll {
    max-height: 160px;
  }

  .cal-option {
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 8px;
  }

  .cal-weekdays span {
    font-size: 10px;
    padding: 4px 0;
  }

  .cal-days {
    gap: 3px;
  }

  .cal-day {
    font-size: 13px;
    border-radius: 8px;
  }

  .cal-day:hover:not(.disabled):not(.selected) {
    transform: translateY(-1px);
  }

  .cal-footer {
    margin-top: 12px;
    padding-top: 10px;
  }

  .cal-btn {
    padding: 7px 14px;
    font-size: 12px;
    border-radius: 8px;
  }

  .gender-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
  }

  .gender-option {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    justify-content: flex-start;
  }

  .subject-option {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
  }

  .submit-btn {
    font-size: 16px;
    padding: 14px;
    margin-top: 24px;
    border-radius: 10px;
  }

  .footer {
    font-size: 13px;
    padding: 20px 10px;
    margin-top: 20px;
  }

  .footer-links {
    margin-top: 8px;
    line-height: 1.8;
  }
}

/* Extra Small Mobile View */
@media (max-width: 360px) {
  .container h1 {
    font-size: 20px;
  }

  .container img {
    width: 85px;
  }

  form {
    padding: 15px 12px;
    width: 98%;
  }

  #dob {
    font-size: 15px;
    padding: 10px 36px 10px 10px;
    min-height: 44px;
  }

  .custom-calendar {
    padding: 10px;
  }

  .cal-select-btn {
    font-size: 13px;
    padding: 4px 6px;
  }

  .cal-dropdown {
    min-width: 90px;
  }

  .cal-option {
    padding: 6px 8px;
    font-size: 12px;
  }

  .cal-nav {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .cal-day {
    font-size: 12px;
    border-radius: 6px;
  }

  .gender-option, .subject-option {
    font-size: 14px;
    padding: 10px;
  }

  .submit-btn {
    font-size: 15px;
  }
}

/* Very Small Mobile - Calendar Touch Optimization */
@media (max-width: 320px) {
  .custom-calendar {
    padding: 8px;
    border-radius: 12px;
  }

  .cal-header {
    margin-bottom: 10px;
  }

  .cal-nav {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }

  .cal-select-btn {
    font-size: 12px;
  }

  .cal-weekdays span {
    font-size: 9px;
  }

  .cal-day {
    font-size: 11px;
  }

  .cal-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
}
