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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Payment background with gradient */
.payment-bg {
  background: linear-gradient(135deg, #f5f7fa 0%, #e8f5e9 100%);
  min-height: 100vh;
  width: 100%;
  padding-bottom: 40px;
}

/* Header section */
.payment-bg .contentpanel {
  margin: 0;
  padding: 0;
  display: block;
}

.payment-bg .header-logo {
  height: 60px;
  width: auto;
  display: inline-block;
}

/* Loading overlay */
.payment-bg .loader-payments {
  position: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  z-index: 9999;
  pointer-events: auto;
  -webkit-overflow-scrolling: touch;
}

.payment-bg .loader-payments[style*="display: none"] {
  pointer-events: none !important;
  visibility: hidden !important;
}

.payment-bg .loader-payments img {
  width: 60px;
  height: 60px;
}

/* Heading section with gradient */
.demat-heading {
  width: 100%;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  padding-left: 20px;
  height: 50px;
  display: flex;
  align-items: center;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
  letter-spacing: 0.3px;
}

/* Welcome message with card design */
.payment-welcome {
  color: #2c3e50;
  font-size: 15px;
  line-height: 1.8;
  padding: 24px;
  text-align: justify;
  background: #ffffff;
  margin: 20px auto;
  max-width: 920px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #28a745;
  font-weight: 600;
}

/* Payment form container with card design */
.payment-form {
  width: 80%;
  max-width: 800px;
  margin: 30px auto;
  display: flex;
  flex-direction: column;
  padding: 32px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.payment-form:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

/* Form rows for details with improved styling */
.demat-number-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 14px 0px;
  font-size: 14px;
  color: #2c3e50;
  font-weight: 500;
  margin-bottom: 8px;
  margin-left: 0;
  margin-right: 0;
  border-bottom: 1px solid #e9ecef;
  transition: all 0.2s ease;
}

.demat-number-details:last-of-type {
  border-bottom: 2px solid #28a745;
  padding-bottom: 18px;
  margin-bottom: 16px;
}

.demat-number-details .demat-text {
  flex: 0 0 auto;
  max-width: 50%;
  white-space: nowrap;
  line-height: 42px;
  padding-left: 0;
  padding-right: 15px;
  text-align: left;
  font-weight: 700;
  color: #2c3e50;
  font-size: 15px;
}

.demat-number-details .payment_formcontrol_details {
  flex: 0 0 50%;
  max-width: 50%;
  pointer-events: none;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #dee2e6;
  padding: 10px 16px;
  height: 42px;
  border-radius: 8px;
  color: #212529;
  font-size: 15px;
  font-weight: 700;
  width: 50%;
  transition: all 0.3s ease;
}

/* Override Bootstrap form-control width */
.demat-number-details .form-control.payment_formcontrol_details {
  width: 50%;
  flex: 0 0 50%;
  max-width: 50%;
}

/* Form rows for input */
.demat-number {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  padding: 10px 0px;
  font-size: 15px;
  color: #2c3e50;
  font-weight: 700;
  margin-bottom: 5px;
  margin-left: 0;
  margin-right: 0;
}

.demat-number .demat-text {
  white-space: nowrap;
  line-height: 38px;
  text-align: left;
  padding-right: 15px;
  font-weight: 700;
  color: #2c3e50;
}

.demat-number .number-field {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.demat-number .payment_formcontrol {
  padding: 10px 16px;
  height: 42px;
  border-radius: 8px;
  background: #fff;
  border: 2px solid #dee2e6;
  width: 100%;
  font-size: 15px;
  transition: all 0.3s ease;
  font-weight: 600;
}

.demat-number .payment_formcontrol:hover {
  border-color: #28a745;
  background: #f8fff9;
}

.demat-number .payment_formcontrol:focus {
  color: #212529;
  outline: none;
  border-color: #28a745;
  box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.15);
  background: #fff;
}

/* Captcha section with improved styling */
.demat-number .number-field .captcha-text {
  margin-top: 12px;
  display: flex;
  align-items: center;
}

.demat-number .number-field .captcha-text img {
  border: 2px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.demat-number .number-field .captcha-text .captcha-refresh {
  margin-left: 12px;
  border: 2px solid #28a745;
  background: linear-gradient(135deg, #fff 0%, #f8fff9 100%);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #28a745;
  transition: all 0.3s ease;
}

.demat-number .number-field .captcha-text .captcha-refresh:hover {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.demat-number .number-field .captcha-text .captcha-refresh:active {
  transform: translateY(0);
}

/* Error messages with enhanced styling */
.error-panel {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-panel .error-text {
  color: #dc3545;
  text-align: center;
  font-size: 14px;
  display: none;
  animation: fadeIn 0.3s ease;
}

.details-error {
  color: #dc3545;
  text-align: center;
  font-size: 14px;
  margin-top: 16px;
  padding: 12px 16px;
  display: none;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  font-weight: 600;
  animation: slideDown 0.3s ease;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

/* Button section with modern design */
.button-panel {
  display: flex;
  justify-content: center;
  margin-top: 32px;
  margin-bottom: 8px;
}

.payment-button {
  border: none;
  color: #fff;
  font-size: 17px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  padding: 0 48px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(40, 167, 69, 0.3);
  position: relative;
  overflow: hidden;
}

.payment-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.payment-button:hover::before {
  left: 100%;
}

.payment-button:hover {
  background: linear-gradient(135deg, #218838 0%, #1ea87f 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(40, 167, 69, 0.4);
}

.payment-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.payment-button:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.25);
}

.payment-button:disabled {
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.6;
}

/* Notes section with card design */
.payment-notes {
  color: #2c3e50;
  margin: 20px auto;
  padding: 24px;
  max-width: 920px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #ffc107;
}

.payment-notes ul {
  font-size: 17px;
  font-weight: 700;
  list-style-position: inside;
  color: #2c3e50;
}

.payment-notes ul li {
  font-size: 16px;
  font-weight: 700;
  margin-top: 12px;
  line-height: 1.8;
  color: #2c3e50;
  padding-left: 8px;
}

.payment-notes-details {
  font-size: 14px;
  color: #2c3e50;
  margin: 20px auto;
  padding: 24px;
  max-width: 920px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #17a2b8;
}

.payment-notes-details ul {
  font-size: 17px;
  font-weight: 700;
  list-style-position: inside;
  color: #2c3e50;
}

.payment-notes-details ul li {
  font-size: 16px;
  font-weight: 700;
  margin-top: 12px;
  line-height: 1.8;
  color: #2c3e50;
  padding-left: 8px;
}

/* Email link styling */
.payment-notes-details ul li a,
.payment-notes ul li a {
  color: #28a745;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  border-bottom: 2px solid transparent;
}

.payment-notes-details ul li a:hover,
.payment-notes ul li a:hover {
  color: #20c997;
  border-bottom: 2px solid #20c997;
}

/* Status message (for success/failure pages) with card design */
.payment-bg .status-message {
  margin: 80px auto;
  max-width: 720px;
  text-align: center;
  color: #2c3e50;
  font-size: 18px;
  padding: 32px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  animation: fadeIn 0.5s ease;
}

.payment-bg .status-message p {
  margin-bottom: 12px;
  line-height: 1.8;
  font-weight: 600;
}

/* Enhanced responsive styles for mobile */
@media only screen and (max-width: 575px) {
  .payment-bg {
    padding-bottom: 20px;
  }

  .payment-form {
    width: 95%;
    padding: 20px 16px;
    margin: 15px auto;
    border-radius: 12px;
  }

  .payment-form:hover {
    transform: none;
  }

  .demat-number,
  .demat-number-details {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 0px;
  }

  .demat-number .demat-text,
  .demat-number-details .demat-text {
    width: 100%;
    max-width: 100%;
    margin-bottom: 8px;
    line-height: 1.5;
    padding-right: 0;
    font-size: 13px;
  }

  .demat-number .number-field {
    width: 100%;
  }

  .demat-number-details .payment_formcontrol_details,
  .demat-number-details .form-control.payment_formcontrol_details {
    width: 100%;
    max-width: 100%;
    font-size: 13px;
    padding: 10px 12px;
    height: 40px;
  }

  .demat-number .number-field .captcha-text {
    flex-direction: column;
    align-items: flex-start;
  }

  .demat-number .number-field .captcha-text .captcha-refresh {
    margin-left: 0;
    margin-top: 10px;
    width: 100%;
  }

  .payment-welcome {
    font-size: 14px;
    padding: 18px;
    margin: 15px 10px;
    border-radius: 10px;
    font-weight: 600;
  }

  .payment-notes,
  .payment-notes-details {
    margin: 15px 10px;
    padding: 18px;
    border-radius: 10px;
  }

  .payment-notes ul,
  .payment-notes-details ul {
    font-size: 14px;
    font-weight: 700;
  }

  .payment-notes ul li,
  .payment-notes-details ul li {
    font-size: 13px;
    font-weight: 600;
  }

  .demat-heading {
    font-size: 14px;
    padding-left: 15px;
    height: 48px;
  }

  .payment-button {
    width: 100%;
    font-size: 15px;
    height: 48px;
    border-radius: 10px;
    padding: 0 24px;
  }

  .button-panel {
    margin-top: 24px;
  }

  .payment-bg .header-logo {
    height: 50px;
  }
}

/* Enhanced tablet adjustments */
@media only screen and (min-width: 576px) and (max-width: 768px) {
  .payment-form {
    width: 90%;
    padding: 28px;
  }

  .demat-number-details .demat-text {
    max-width: 45%;
  }

  .demat-number-details .payment_formcontrol_details,
  .demat-number-details .form-control.payment_formcontrol_details {
    max-width: 55%;
  }

  .payment-welcome,
  .payment-notes,
  .payment-notes-details {
    margin: 18px 15px;
  }
}

/* Large tablets and small desktops */
@media only screen and (min-width: 769px) and (max-width: 991px) {
  .payment-form {
    width: 85%;
    max-width: 750px;
  }
}