/* Basic reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', sans-serif;
  background: #e9eff5;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

/* Container */
.pos-wrapper {
  width: 100%;
  max-width: 450px;
  padding: 10px;
}

.pos-box {
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #2c3e50;
}

/* Section */
.section {
  margin-bottom: 15px;
}

label {
  font-weight: 500;
}

.radio-group {
  display: flex;
  justify-content: space-around;
  margin-top: 5px;
}

.radio-group label {
  cursor: pointer;
}

/* Inputs */
input {
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  font-size: 18px;
  border: 1px solid #ccc;
  border-radius: 8px;
  text-align: center;
  transition: 0.3s;
}

input:focus {
  border-color: #2980b9;
  outline: none;
}

/* Number pad */
.num-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 15px 0;
}

.num-pad button {
  padding: 15px;
  font-size: 18px;
  border: none;
  background: #3498db;
  color: white;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s;
}

.num-pad button:hover {
  background: #2980b9;
}

.clear-btn {
  grid-column: span 3;
  background: #e74c3c;
  color: white;
  font-weight: 500;
  border-radius: 10px;
  padding: 14px;
  font-size: 16px;
  transition: 0.2s;
}

.clear-btn:hover {
  background: #c0392b;
}

#payBtn {
  width: 100%;
  padding: 14px;
  font-size: 18px;
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
}

#payBtn:hover {
  background: #1e874b;
}

#message {
  text-align: center;
  margin-top: 15px;
  font-weight: bold;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: white;
  margin: 15% auto;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 350px;
  text-align: center;
}

.modal-actions {
  margin-top: 20px;
  display: flex;
  justify-content: space-around;
}

.modal-actions .yes {
  background: #27ae60;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
}

.modal-actions .no {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
}

/* Responsive */
@media (max-width: 500px) {
  .pos-box {
    padding: 20px;
  }

  .num-pad button {
    padding: 12px;
    font-size: 16px;
  }

  #payBtn {
    font-size: 16px;
  }
}

/* Navigation buttons (Next / Back) */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
}

.nav-btn {
  flex: 1;
  margin: 0 5px;
  background: #34495e;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: 0.2s;
}

.nav-btn:hover {
  background: #2c3e50;
}

/* Highlight active field visually */
input:focus {
  border-color: #2980b9;
  box-shadow: 0 0 5px #2980b9;
}


/* ----- Custom Radio Card Style ----- */

.section-title {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2c3e50;
}

.toggle-group {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.toggle-group input[type="radio"] {
  display: none; /* hide the default radio */
}

.toggle-card {
  flex: 1;
  background: #f4f6f8;
  color: #2c3e50;
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.25s ease;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.toggle-card i {
  font-size: 22px;
  margin-bottom: 6px;
  color: #7f8c8d;
  transition: color 0.25s ease;
}

.toggle-card span {
  font-weight: 500;
}

.toggle-group input[type="radio"]:checked + .toggle-card {
  background: #3498db;
  color: #fff;
  border-color: #2980b9;
  box-shadow: 0 4px 10px rgba(52, 152, 219, 0.4);
}

.toggle-group input[type="radio"]:checked + .toggle-card i {
  color: #fff;
}

.toggle-card:hover {
  background: #ecf5ff;
  border-color: #3498db;
}

/* Responsive tweak */
@media (max-width: 480px) {
  .toggle-group {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .toggle-card {
    flex: 1 1 45%;
    padding: 10px;
    font-size: 14px;
  }

  .toggle-card i {
    font-size: 18px;
  }
}

/* Navigation (Next/Back) Buttons beside 0 */
.nav-btn.small-btn {
  background: #34495e;
  color: #fff;
  font-size: 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s;
}

.nav-btn.small-btn:hover {
  background: #2c3e50;
}

input:focus {
  border-color: #3498db;
  box-shadow: 0 0 6px rgba(52, 152, 219, 0.6);
}


/* Login Page */
.login-body {
  background: linear-gradient(135deg, #2980b9, #6dd5fa);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  text-align: center;
  width: 90%;
  max-width: 350px;
}

.login-container h2 {
  margin-bottom: 20px;
  color: #2c3e50;
}

.login-container input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
}

#loginBtn {
  width: 100%;
  background: #3498db;
  color: white;
  padding: 12px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  margin-top: 10px;
}

#loginBtn:hover {
  background: #2980b9;
}

#loginMessage {
  margin-top: 12px;
  font-weight: 500;
}

/* Modal PIN Section */
.pin-section {
  margin-top: 15px;
  text-align: center;
}

.pin-section label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #2c3e50;
}

#pinInput {
  width: 120px;
  padding: 10px;
  font-size: 22px;
  text-align: center;
  border: 2px solid #ccc;
  border-radius: 8px;
  letter-spacing: 5px;
  font-weight: bold;
  transition: border-color 0.3s ease;
}

#pinInput:focus {
  border-color: #3498db;
  outline: none;
  box-shadow: 0 0 6px rgba(52,152,219,0.6);
}

.swal2-confirm {
  background-color: #27ae60 !important;
  border-radius: 8px !important;
}

.swal2-cancel {
  background-color: #e74c3c !important;
  border-radius: 8px !important;
}

.swal2-title {
  font-weight: 600 !important;
  color: #2c3e50 !important;
}

/* Logout Button */
.logout-container {
  position: absolute;
  top: 15px;
  right: 20px;
}

#logoutBtn {
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

#logoutBtn:hover {
  background: #c0392b;
}

#logoutBtn i {
  font-size: 16px;
}

/* Code Detection Info */
.code-info {
  font-size: 15px;
  margin-top: -5px;
  margin-bottom: 10px;
  text-align: center;
  color: #555;
  font-weight: 500;
  min-height: 22px;
  transition: color 0.3s ease;
}

.code-info span {
  font-weight: bold;
  color: #2c3e50;
}

/* 🔹 Service Type Button Group */
.service-type-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;   /* ✅ scroll if small screens */
  padding: 5px;
  scrollbar-width: none; /* Firefox */
}

.service-type-group::-webkit-scrollbar {
  display: none; /* ✅ hide scrollbar for mobile */
}

.service-type-group input[type="radio"] {
  display: none;
}

.service-type-group label {
  flex: 1;
  min-width: 90px;
  text-align: center;
  padding: 10px 0;
  border-radius: 10px;
  background-color: #f4f5f7;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;  /* ✅ prevent wrapping */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ✅ Selected (active) style */
.service-type-group input[type="radio"]:checked + label {
  background-color: #007bff;
  color: white;
  font-weight: 600;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.4);
}

/* ✅ Responsive tweak for mobile */
@media (max-width: 480px) {
  .service-type-group {
    gap: 6px;
  }
  .service-type-group label {
    font-size: 13px;
    padding: 8px 0;
    min-width: 80px;
  }
}

.recharge-type-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.recharge-type-group input[type="radio"] {
  display: none;
}

.recharge-type-group label {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  border-radius: 10px;
  background-color: #f4f5f7;
  cursor: pointer;
  color: #333;
  font-weight: 500;
  transition: 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.recharge-type-group input[type="radio"]:checked + label {
  background-color: #007bff;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.4);
}

#numberField, 
#amountField {
  font-size: 26px;        /* Increase digit size */
  font-weight: 600;       /* Make digits bold for readability */
  text-align: center;     /* Center-align numbers */
  height: 50px;           /* Increase input box height */
  letter-spacing: 2px;    /* Add spacing between digits */
  caret-color: #007bff;   /* Blue caret for better visibility */
}
