/*
  Action button. Colors come from CSS variables so each place can override them:
  - global defaults: :root below, replaced by the Web Application > Button Style colors (main_template)
  - one button: inline style from Button Manager (theme_action_button)
  - form submit buttons: Page Design (theme.css)
*/
:root {
  --btn-bg1: #9cc8f9;
  --btn-bg2: #0d5aae;
  --btn-hover1: #dc7f1b;
  --btn-hover2: #a10dae;
  --btn-text: #ffffff;
  --btn-hover-text: #ffffff;
  --btn-w: 300px;
  --btn-h: 50px;
  --btn-radius: 1000px;
}

.ButtonStyle {
  width: var(--btn-w);
  max-width: 100%;
  min-height: var(--btn-h);
  padding: 0 1.25rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: linear-gradient(to bottom, var(--btn-bg1), var(--btn-bg2));
  border-radius: var(--btn-radius);
  color: var(--btn-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  font: normal bold 18px 'Open Sans', 'Noto Sans Thai', sans-serif;
  line-height: 1.2;
  text-align: center;
  letter-spacing: 0.12rem;
  text-transform: uppercase;
  transition: transform .25s ease, box-shadow .25s ease, color .2s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .45);
  -webkit-tap-highlight-color: transparent;
}

.ButtonStyle span,
a.ButtonStyle span {
  color: inherit;
  line-height: inherit;
}

.ButtonStyle .bi {
  font-size: 1.15em;
  line-height: 1;
}

.ButtonStyle.is-solid {
  background: var(--btn-bg1);
}

.ButtonStyle.is-outline {
  background: transparent;
  color: var(--btn-bg1);
  box-shadow: inset 0 0 0 2px var(--btn-bg1);
}

.ButtonStyle.Logout {
  width: 100px !important;
  min-height: 40px;
  font-size: 89%;
  padding: 0 .5rem;
}

.ButtonStyle.Document {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 89%;
}

button.swal2-confirm, button.swal2-cancel {
  font-size: 100%;
  width: 130px;
}

.ButtonStyle:before {
  content: '';
  position: absolute;
  background: linear-gradient(145deg, var(--btn-hover1), var(--btn-hover2));
  border-radius: inherit;
  z-index: -1;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  opacity: 0;
  transition: all 0.25s ease-in-out;
}

.ButtonStyle:hover,
.ButtonStyle:focus-visible {
  color: var(--btn-hover-text);
  transform: translateY(-3px);
  box-shadow: 0 14px 26px -12px rgba(0, 0, 0, .5);
}

.ButtonStyle:hover:before,
.ButtonStyle:focus-visible:before {
  opacity: 1;
  height: 100%;
}

.ButtonStyle:focus-visible {
  outline: 3px solid rgba(255, 255, 255, .8);
  outline-offset: 2px;
}

.ButtonStyle:active {
  transform: translateY(0);
}

@media (max-width: 991.98px) {
  .ButtonStyle {
    font-size: 16px;
  }
}

/* phones: smaller type, tighter letters and a softer shadow, so a column of buttons does not look heavy */
@media (max-width: 575.98px) {
  .ButtonStyle {
    font-size: 15px;
    letter-spacing: .06em;
    padding: 0 1rem;
    box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .4);
  }

  .ButtonStyle:hover,
  .ButtonStyle:focus-visible {
    box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .45);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ButtonStyle,
  .ButtonStyle:before {
    transition: none;
  }
  .ButtonStyle:hover {
    transform: none;
  }
}
