/* =========================================
   Page & Layout Containers
   ========================================= */
.totp-page-container {
  max-width: 583px !important;
  height: 100% !important;
  padding-right: 1px !important;
  padding-left: 1px !important;
  margin-top: 1px !important;
}

.totp-content-wrapper {
  margin-top: 0 !important;
}

#input-error-otp-code {
  margin: 0 auto !important;
  text-align: left;
  padding: 0 1rem;
}

/* Main Card Container */
#totp-container-card {
  padding: 0 3rem;
}

#totp-success-container {
  padding: 0 3rem;
  text-align: center;
}

/* Typography */
.totp-main-title {
  font-size: 32px;
  font-weight: 500;
  /* Inherited from #kc-page-title */
  text-align: center;
  color: #444;
  margin-top: 0;
  margin-bottom: 2rem;
}

p.totp-instruction {
  font-size: 1rem;
  color: #555;
  text-align: left;
  line-height: 1.5;
}

.font-bold {
  font-weight: 700;
}

.text-center {
  text-align: center;
}

.totp-qr-wrapper {
  text-align: center;
}

#totp-qr-image {
  display: block;
  width: 210px;
  height: 210px;
  margin: 0 auto;
  border-radius: 4px;
}

.totp-manual-wrapper {
  display: flex;
  align-items: center;
  flex-direction: column;
}

.totp-secret-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.35rem 1rem;
  width: fit-content;
}

#totp-secret-key-display {
  color: #B4B4B4;
}

/* Technical Details List */
.totp-tech-details {
  margin-top: 1.5rem;
}

.totp-tech-details p {
  margin-bottom: 0.5rem;
}

.totp-details-list {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
  font-size: 14px !important;
}

.totp-details-list li {
  padding: 0.25rem 0;
  color: #444;
}


/* Links (Switch Mode) */
a.totp-switch-link {
  color: #5F5F5F;
  font-size: 16px;
  line-height: 26px;
  text-decoration: none;
}

/* Form Layout */
#kc-totp-settings-form {
  margin-top: 2rem;
  position: relative;
}

.totp-input-group {
  display: flex;
  gap: 1rem;
  /* Renamed from gap1 */
}

.totp-field-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  text-align: center;
}

.totp-field-wrapper-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  text-align: center;
}

.totp-input-label {
  font-weight: normal;
  margin-bottom: 1rem;
}

#kc-totp-form-login input[type="text"] {
  width: 90%;
  /* Fallback */
  font-size: .9rem !important;
  --bs-form-control-bg: #fff;
  border-radius: 5px;
  padding: 1rem .75rem;
  border: 2px solid lightgray;
}

#kc-totp-form-login input[type="text"]::placeholder {
  color: #999;
}

/* Input Fields */
#kc-totp-settings-form input[type="text"] {
  width: 90%;
  /* Fallback */
  font-size: .9rem !important;
  --bs-form-control-bg: #fff;
  border-radius: 5px;
  padding: .5rem .75rem;
  border: 2px solid lightgray;
  text-align: center;
}

.totp-field-wrapper input[type="text"]:focus {
  outline: none !important;
  box-shadow: none !important;
  border-color: #ccc !important;
}

.totp-field-wrapper input[type="text"] {
  width: 300px !important;
  letter-spacing: 0.5rem;
  font-size: 22px;
}

.totp-field-wrapper input[type="text"]::placeholder {
  letter-spacing: 0;
  opacity: 0.6;
}

.totp-field-wrapper-login input[type="text"]:focus {
  outline: none !important;
  box-shadow: none !important;
  border-color: #ccc !important;
}

.totp-field-wrapper-login input[type="text"] {
  width: 300px !important;
  letter-spacing: 0.5rem;
  font-size: 22px;
}

.totp-field-wrapper-login input[type="text"]::placeholder {
  letter-spacing: 0;
  opacity: 0.6;
}



#kc-totp-settings-form input[type="text"]::placeholder {
  color: #999;
}

/* Submit Buttons */
#totp-submit-wrapper {
  margin: 0 auto;
  max-width: 300px;
  text-align: center;
  margin-top: 1rem;
}

#totp-submit-wrapper input[type="submit"] {
  width: 300px !important;
  padding: 0.5rem 2rem;
}

/* =========================================
   Utilities / Legacy overrides
   ========================================= */
/* Checkbox Styling (kept if needed elsewhere) */
.form-group-checkbox {
  margin-bottom: 1.5rem;
}

.form-group-checkbox .checkbox {
  display: flex;
}

.otp-check-acknowledgement {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem auto;
  max-width: 400px;
}

.otp-check-acknowledgement label {
  font-weight: 700 !important;
  display: flex;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
}

.otp-check-acknowledgement input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: #5DCDF1;
  border: 2px solid #B4B4B4;
  border-radius: 3px;
}

.otp-check-acknowledgement input[type="checkbox"]:checked {
  background-color: #5DCDF1;
  border-color: #5DCDF1;
}

.form-group-checkbox input[type="checkbox"] {
  margin-right: 0.5rem;
}

/* =========================================
   Responsive Design
   ========================================= */
@media (max-width: 768px) {

  .totp-page-container {
    height: 100% !important;
    margin-top: 8rem !important;
  }

  .totp-input-group {
    flex-direction: column !important;
    gap: 1.5rem;
  }

  #totp-container-card {
    padding: .5rem;
    margin: 1rem;
  }

  /* Form Styles */
  #kc-totp-settings-form {
    margin-top: 1px;
  }

  p.totp-instruction {
    font-size: .9rem;
  }

  .totp-input-label {
    font-size: .9rem;
  }

  .totp-field-wrapper {
    margin-bottom: -.3rem;
  }

  .totp-field-wrapper-login {
    margin-bottom: -.3rem;
  }
}


.custom-modal-overlay {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.custom-modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 30px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  font-family: inherit;
  color: #333;
  text-align: left;
}

.custom-modal-message {
  margin: 2rem 0;
  text-align: center;
  ;
  padding: 0 2rem;
}

.custom-modal-close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  top: 10px;
  right: 20px;
  line-height: 1;
}

.custom-modal-close:hover,
.custom-modal-close:focus {
  color: black;
  text-decoration: none;
}

.custom-modal-title {
  font-size: 20px;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 20px;
  text-align: center;
  color: #000;
}

.custom-modal-list {
  list-style-type: disc;
  padding-left: 20px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}

.custom-modal-list li {
  margin-bottom: 15px;
}

.custom-modal-sublist {
  list-style-type: disc;
  margin-top: 5px;
  padding-left: 20px;
}

.custom-modal-sublist li {
  margin-bottom: 5px;
}

.custom-modal-footer {
  font-size: 14px;
  line-height: 1.5;
  margin-top: 20px;
  color: #555;
}