.akf-auth-page,
.akf-auth-mobile-page {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

/* Keep legacy auth forms and the shared footer in one compact content flow. */
.akf-auth-mobile-page .akf-app-main {
  min-height: auto;
}

.akf-auth-mobile-page .akf-app-main > .container {
  margin-bottom: clamp(10px, 2vw, 16px) !important;
}

.akf-auth-mobile-page .akf-app-footer {
  padding: 8px 16px 14px;
}

.akf-auth-page .akf-app-shell,
.akf-auth-page .akf-app-main,
.akf-auth-page .akf-auth-wrap,
.akf-auth-page .akf-auth-card,
.akf-auth-page .akf-sms-shell,
.akf-auth-page .akf-sms-card,
.akf-auth-mobile-page .akf-app-shell,
.akf-auth-mobile-page .akf-app-main,
.akf-auth-mobile-page .container,
.akf-auth-mobile-page .row,
.akf-auth-mobile-page [class*="col-"],
.akf-auth-mobile-page .card,
.akf-auth-mobile-page form,
.akf-auth-mobile-page fieldset,
.akf-auth-mobile-page .input-group {
  min-width: 0;
  max-width: 100%;
}

.akf-auth-page :where(form, fieldset, label, .akf-auth-field, .akf-auth-input, .akf-otp-inputs, .akf-password-reset-form),
.akf-auth-mobile-page :where(form, fieldset, label, .form-control, .form-select, .input-group, .rules-box, .rule, .agree-wrap) {
  min-width: 0;
}

.akf-auth-page :where(input, select, textarea),
.akf-auth-mobile-page :where(input, select, textarea) {
  max-width: 100%;
}

.akf-auth-page :where(.akf-auth-alert, .akf-auth-subtitle, .akf-auth-register, .akf-sms-description, .akf-sms-alert, .akf-sms-hint, .akf-sms-security),
.akf-auth-mobile-page :where(h1, h2, h3, h4, p, .alert, .alert-official, .rules-title, .rules-sub, .rt, .rd, .hint, .muted) {
  overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
  .akf-auth-page :where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), select, textarea),
  .akf-auth-mobile-page :where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), select, textarea) {
    font-size: 16px !important;
  }

  .akf-auth-page .akf-app-main {
    width: 100%;
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
    overflow-x: clip;
  }

  .akf-auth-page .akf-auth-wrap,
  .akf-auth-page .akf-sms-shell {
    width: 100%;
  }

  .akf-auth-mobile-page .container {
    width: 100%;
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .akf-auth-mobile-page .row {
    margin-right: 0;
    margin-left: 0;
  }

  .akf-auth-mobile-page [class*="col-"] {
    width: 100%;
    padding-right: 0;
    padding-left: 0;
  }

  .akf-auth-mobile-page .card {
    width: 100%;
    padding: 18px !important;
  }

  .akf-auth-mobile-page .input-group {
    flex-wrap: nowrap;
  }

  .akf-auth-mobile-page .input-group > .form-control {
    width: 1%;
    min-width: 0;
  }

  .akf-auth-mobile-page .input-group-text {
    flex: 0 0 auto;
  }

  .akf-auth-mobile-page .agree-wrap > .d-flex {
    width: 100%;
    flex-wrap: wrap;
  }

  .akf-auth-mobile-page .agree-wrap > .d-flex > .btn {
    flex: 1 1 140px;
  }
}

@media (max-width: 380px) {
  .akf-auth-page .akf-auth-card,
  .akf-auth-page .akf-sms-card,
  .akf-auth-mobile-page .card {
    padding: 16px !important;
    border-radius: 16px;
  }

  .akf-auth-page .akf-otp-inputs {
    gap: 4px;
  }
}
