/* ==========================================
   COMBINED DRIVER SERVICE RECRUITMENT
   Modern UI
==========================================*/

:root {
  --primary: #0f4c81;
  --primary-dark: #09345a;
  --secondary: #1e88e5;

  --success: #2e7d32;
  --danger: #d32f2f;

  --background: #f3f7fb;

  --card: #ffffff;

  --border: #d9e2ec;

  --text: #263238;

  --text-light: #607d8b;

  --radius: 16px;

  --shadow: 0 12px 30px rgba(0, 0, 0, 0.08);

  --transition: 0.3s;
}

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

body {
  font-family: "Poppins", "Noto Sans Sinhala", sans-serif;

  background: var(--background);

  color: var(--text);

  line-height: 1.5;
}

.page {
  width: min(1400px, 95%);

  margin: auto;

  padding: 40px 0 60px;
}

.hero {
  background: linear-gradient(135deg, var(--primary), var(--secondary));

  color: white;

  border-radius: 20px;

  padding: 40px;

  box-shadow: var(--shadow);

  display: flex;

  align-items: center;

  gap: 30px;

  margin-bottom: 30px;
}

.logo {
  width: 120px;

  height: 120px;

  flex-shrink: 0;
}

.logo img {
  width: 100%;

  height: 100%;

  object-fit: contain;
}

.hero h1 {
  font-size: 2rem;

  margin: 8px 0;
}

.hero h2 {
  font-size: 1.1rem;

  font-weight: 500;
}

.hero p {
  margin-top: 12px;

  opacity: 0.9;
}

.progress-card {
  background: white;

  border-radius: 16px;

  padding: 20px;

  margin-bottom: 30px;

  box-shadow: var(--shadow);
}

.progress-title {
  display: flex;

  justify-content: space-between;

  margin-bottom: 12px;

  font-weight: 600;
}

.progress {
  width: 100%;

  height: 12px;

  background: #e5eaf0;

  border-radius: 20px;

  overflow: hidden;
}

.progress-bar {
  width: 0%;

  height: 100%;

  background: linear-gradient(90deg, var(--primary), var(--secondary));

  transition: 0.5s;
}

.card {
  background: white;

  border-radius: 16px;

  margin-bottom: 24px;

  box-shadow: var(--shadow);

  overflow: hidden;
}

.card summary {
  list-style: none;

  cursor: pointer;

  padding: 22px;

  display: flex;

  align-items: center;

  gap: 12px;

  font-size: 18px;

  font-weight: 600;

  user-select: none;
}

summary::-webkit-details-marker {
  display: none;
}

.card summary:hover {
  background: #f8fafc;
}

.card-body {
  padding: 30px;

  border-top: 1px solid var(--border);
}

.grid {
  display: grid;

  grid-template-columns: repeat(2, 1fr);

  gap: 24px;
}

.full {
  grid-column: 1/-1;
}

.field label {
  display: block;

  margin-bottom: 8px;

  font-weight: 500;
}

.field span {
  color: red;
}

.field input,
.field select,
.field textarea,
.verification-row input {
  width: 100%;

  padding: 14px 16px;

  border: 1px solid var(--border);

  border-radius: 10px;

  font-size: 15px;

  transition: 0.25s;

  background: white;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.verification-row input:focus {
  outline: none;

  border-color: var(--secondary);

  box-shadow: 0 0 0 4px rgba(30, 136, 229, 0.15);
}

input[readonly] {
  background: #eef3f8;
}

.coming-soon {
  padding: 40px;

  text-align: center;

  color: #607d8b;
}

.submit-btn {
  width: 100%;

  padding: 18px;

  border: none;

  border-radius: 14px;

  background: linear-gradient(135deg, var(--primary), var(--secondary));

  color: white;

  font-size: 18px;

  font-weight: 600;

  cursor: pointer;

  transition: 0.3s;
}

.submit-btn:hover {
  transform: translateY(-3px);

  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

@media (max-width: 900px) {
  .hero {
    flex-direction: column;

    text-align: center;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .full {
    grid-column: auto;
  }
}

@media (max-width: 500px) {
  .page {
    width: 96%;
  }

  .hero {
    padding: 25px;
  }

  .card summary {
    font-size: 16px;
  }

  .card-body {
    padding: 20px;
  }
}

.section-divider {
  margin: 35px 0;

  border: none;

  border-top: 1px solid var(--border);
}

.sub-heading {
  margin-bottom: 20px;

  font-size: 18px;

  color: var(--primary);
}

.licence-grid {
  display: grid;

  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));

  gap: 15px;

  margin-bottom: 30px;
}

.check-card {
  border: 1px solid var(--border);

  border-radius: 12px;

  text-align: center;

  padding: 20px;

  cursor: pointer;

  transition: 0.3s;

  background: white;

  font-weight: 600;
}

.check-card:hover {
  border-color: var(--secondary);

  transform: translateY(-2px);
}

.check-card input {
  display: none;
}

.check-card input:checked + span {
  color: white;

  background: var(--secondary);

  display: block;

  padding: 10px;

  border-radius: 8px;
}

.eligibility-box {
  margin-top: 30px;

  background: #f7fafd;

  border-left: 5px solid var(--primary);

  padding: 20px;

  border-radius: 12px;
}

/* ==============================
 Declaration
============================== */

.declaration-box {
  background: #f8fafc;

  border-left: 5px solid #0056b3;

  padding: 20px;

  border-radius: 10px;
}

.declaration-check {
  display: flex;

  gap: 15px;

  align-items: flex-start;

  cursor: pointer;
}

.declaration-check input {
  margin-top: 5px;
}

/* ==============================
 Submit
============================== */

.submit-card {
  margin-top: 30px;

  text-align: center;
}

#submitButton {
  background: #0056b3;

  color: white;

  border: none;

  padding: 15px 45px;

  border-radius: 12px;

  font-size: 16px;

  cursor: pointer;

  transition: 0.3s;
}

#submitButton:hover {
  transform: translateY(-2px);
}

#submitButton:disabled {
  opacity: 0.6;

  cursor: not-allowed;
}

.form-message {
  margin-top: 20px;

  font-weight: 600;
}

/* ==============================
 Footer
============================== */

.footer {
  text-align: center;

  padding: 30px;

  margin-top: 10px;

  color: #666;

  font-size: 14px;
}

/* ==========================================
   NIC Verification
==========================================*/

.verification-card {
  background: var(--card);

  border-radius: var(--radius);

  box-shadow: var(--shadow);

  margin-bottom: 30px;

  overflow: hidden;
}

.verification-header {
  display: flex;

  align-items: center;

  gap: 12px;

  padding: 22px 30px;

  background: linear-gradient(135deg, var(--primary), var(--secondary));

  color: white;
}

.verification-header i {
  font-size: 26px;
}

.verification-header h2 {
  font-size: 20px;

  font-weight: 600;
}

.verification-body {
  padding: 10px;
}

.verification-text {
  color: var(--text-light);

  margin-bottom: 25px;

  line-height: 1.6;
}

.verification-row {
  display: flex;

  gap: 15px;

  align-items: center;
}

.verification-row input {
  flex: 1;
}

#verifyButton {
  background: linear-gradient(135deg, var(--primary), var(--secondary));

  color: white;

  border: none;

  padding: 14px 28px;

  border-radius: 10px;

  font-size: 15px;

  font-weight: 600;

  cursor: pointer;

  transition: 0.3s;

  white-space: nowrap;
}

#verifyButton:hover {
  transform: translateY(-2px);

  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
}

#verifyButton:disabled {
  opacity: 0.7;

  cursor: not-allowed;
}

#verificationMessage {
  margin-top: 25px;

  padding: 18px;

  border-radius: 10px;

  font-size: 15px;

  display: none;
}

#verificationMessage.success {
  display: block;

  background: #e8f5e9;

  border-left: 5px solid #2e7d32;

  color: #2e7d32;
}

#verificationMessage.error {
  display: block;

  background: #ffebee;

  border-left: 5px solid #d32f2f;

  color: #d32f2f;
}

#verificationMessage.loading {
  display: block;

  background: #e3f2fd;

  border-left: 5px solid #1976d2;

  color: #1565c0;
}

@media (max-width: 768px) {
  .verification-row {
    flex-direction: column;
  }

  #verifyButton {
    width: 100%;
  }
}

/* =====================================
 SUCCESS OVERLAY
===================================== */

.success-overlay {
  position: fixed;

  top: 0;

  left: 0;

  width: 100%;

  height: 100%;

  background: rgba(0, 0, 0, 0.55);

  display: none;

  justify-content: center;

  align-items: center;

  z-index: 9999;

  backdrop-filter: blur(5px);
}

.success-modal {
  background: white;

  width: min(450px, 90%);

  padding: 40px 30px;

  border-radius: 20px;

  text-align: center;

  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);

  animation: scaleIn 0.4s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0.5);

    opacity: 0;
  }

  to {
    transform: scale(1);

    opacity: 1;
  }
}

.success-icon {
  display: flex;

  justify-content: center;

  margin-bottom: 25px;
}

.checkmark {
  width: 90px;

  height: 90px;

  border-radius: 50%;

  background: #2e7d32;

  color: white;

  font-size: 55px;

  display: flex;

  align-items: center;

  justify-content: center;

  animation: tickAnimation 0.6s ease;
}

@keyframes tickAnimation {
  0% {
    transform: scale(0);
  }

  80% {
    transform: scale(1.15);
  }

  100% {
    transform: scale(1);
  }
}

.success-modal h2 {
  color: #2e7d32;

  margin-bottom: 15px;
}

.success-modal p {
  color: #555;
}

.application-number {
  margin: 25px 0;

  padding: 15px;

  background: #f1f5f9;

  border-radius: 10px;

  font-size: 18px;
}

.application-number strong {
  display: block;

  color: #0f4c81;

  font-size: 22px;

  margin-top: 8px;
}

#successOkButton {
  background: #0f4c81;

  color: white;

  border: none;

  padding: 14px 45px;

  border-radius: 10px;

  font-size: 16px;

  cursor: pointer;
}

#successOkButton:hover {
  transform: translateY(-2px);
}

/* =====================================
 SUBMIT BUTTON LOADING ANIMATION
===================================== */

#submitButton.loading {
  cursor: not-allowed;

  opacity: 0.8;

  transform: none;
}

#submitButton .spinner {
  width: 18px;

  height: 18px;

  border: 3px solid rgba(255, 255, 255, 0.4);

  border-top-color: white;

  border-radius: 50%;

  display: inline-block;

  margin-right: 10px;

  vertical-align: middle;

  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Success pulse */

#submitButton.success {
  background: #2e7d32;

  animation: successPulse 0.5s ease;
}

@keyframes successPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

/* =====================================
   O/L EDUCATION
===================================== */

.education-table {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.education-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.education-row:last-child {
  border-bottom: none;
}

.education-header {
  background: #f1f5f9;
  font-weight: 600;
  color: var(--primary);
}

.subject-name {
  font-weight: 500;
}

.subject-name span {
  color: red;
}

.education-row .field {
  width: 100%;
}

.education-row .field input {
  width: 100%;
}

.ol-result {
  text-transform: uppercase;
}

.additional-title {
  padding: 16px;
  background: #f8fafc;
  color: var(--primary);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.additional-row {
  background: #ffffff;
}


/* Mobile */

@media (max-width: 600px) {

  .education-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .education-header {
    display: none;
  }

  .subject-name {
    margin-bottom: 4px;
  }

}

/* =====================================
   DRIVING EXPERIENCE
===================================== */

.section-description {
  color: var(--text-light);
  margin-bottom: 25px;
  font-size: 14px;
}

.experience-block {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 25px;
  margin-bottom: 25px;
}

.experience-title {
  display: flex;
  align-items: center;
  gap: 10px;

  color: var(--primary);

  font-size: 17px;

  margin-bottom: 22px;

  padding-bottom: 12px;

  border-bottom: 1px solid var(--border);
}

.experience-title i {
  font-size: 18px;
}

.experience-block .grid {
  margin-top: 5px;
}

.experience-block input[readonly] {
  background: #eef3f8;
  font-weight: 500;
}

#totalExperience {
  margin-top: 8px;
  font-weight: 500;
}

