/*
$JA#COPYRIGHT$
*/


// ------------------------------------------------------
// FORM ELEMENTS
// ------------------------------------------------------

//
// GENERIC STYLES (forms.less)
// --------------------------------------------------

form {}

fieldset {}

legend {}

label {
  color: @gray-darker;
}


// Adjust output element
output {}


// Common form controls
// --------------------
// Shared size and type resets for form controls. Apply `.form-control` to any
// of the following form controls:
//
// select
// textarea
// input[type="text"]
// input[type="password"]
// input[type="datetime"]
// input[type="datetime-local"]
// input[type="date"]
// input[type="month"]
// input[type="time"]
// input[type="week"]
// input[type="number"]
// input[type="email"]
// input[type="url"]
// input[type="search"]
// input[type="tel"]
// input[type="color"]
.form-control {

  // Customize the `:focus` state to imitate native WebKit styles.
  .form-control-focus();

  // Placeholder
  .placeholder();

  // Disabled and read-only inputs
  &[disabled],
  &[readonly],
  fieldset[disabled] & {}

  // Reset height for `textarea`s
  textarea& {
    height: auto;
  }

}


// Form groups
// -----------
.form-group {
  margin-bottom: @t3-global-margin/2;
}


// Checkboxes and radios
// ---------------------
.radio,
.checkbox {
  label {
    display: inline;
  }
}

.radio input[type="radio"],
.radio-inline input[type="radio"],
.checkbox input[type="checkbox"],
.checkbox-inline input[type="checkbox"] {}

.radio+.radio,
.checkbox+.checkbox {}

// Radios and checkboxes on same line
.radio-inline,
.checkbox-inline {}

.radio-inline+.radio-inline,
.checkbox-inline+.checkbox-inline {}


// Form control sizing
// -------------------
.input-sm {}

.input-lg {}


// Form control feedback states
// ----------------------------
// Apply contextual and semantic states to individual form controls.

// Warning
.has-warning {}

// Error
.has-error {}

// Success
.has-success {}


// Static form control text
// ------------------------
// Apply class to a `p` element to make any string of text align with labels in
// a horizontal form layout.

.form-control-static {
  margin-bottom: 0; // Remove default margin from `p`
}


// Help text
// ---------
// Apply to any element you wish to create light text for placement immediately
// below a form control. Use for general help, formatting, or instructional text.

.help-block {}



// Inline forms
// ------------
// Make forms appear inline(-block) by adding the `.form-inline` class. Inline
// forms begin stacked on extra small (mobile) devices and then go inline when
// viewports reach <768px.
//
// Requires wrapping inputs and labels with `.form-group` for proper display of
// default HTML form controls and our custom form controls (e.g., input groups).
//
// Heads up! This is mixin-ed into `.navbar-form` in navbars.less.

.form-inline {

  @media (min-width: @screen-sm) {

    .form-group {
      display: inline-block;
    }

    // In navbar-form, allow folks to *not* use `.form-group`
    .form-control {
      display: inline-block;
    }

    // Remove default margin on radios/checkboxes that were used for stacking, and
    // then undo the floating of radios and checkboxes to match (which also avoids
    // a bug in WebKit: https://github.com/twbs/bootstrap/issues/1969).
    .radio,
    .checkbox {}

    .radio input[type="radio"],
    .checkbox input[type="checkbox"] {
      float: none;
    }

  }

  // End
}


// Horizontal forms
// ----------------
// Horizontal forms are built on grid classes and allow you to create forms with
// labels on the left and inputs on the right.

.form-horizontal {

  // Consistent vertical alignment of labels, radios, and checkboxes
  .control-label,
  .radio,
  .checkbox,
  .radio-inline,
  .checkbox-inline {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: (@padding-base-vertical + 1); // Default padding plus a border
  }

  // Make form groups behave like rows
  .form-group {}

  .form-control-static {
    padding-top: (@padding-base-vertical + 1);
  }

  @media (max-width: @screen-xs-max) {
    .control-group .controls {
      margin-left: 0;
    }
  }

}


//
// INPUT GROUPS (input-groups.less)
// --------------------------------------------------
// T3 Note: See "bootstrap/input-group.less"
//  if you want to style this components



//
// BUTTONS (buttons.less)
// --------------------------------------------------

// Base styles
// --------------------------------------------------

// Core styles
.btn {
  padding: @padding-base-vertical @padding-base-horizontal;
  border-radius: @border-radius-small;
  font-weight: @font-weight-bold;

  &:focus {
    outline: none;
  }

  &:hover,
  &:focus {
    outline: none;
  }

  &:active,
  &.active,
  &:active:focus {
    outline: none;
  }

  &.disabled,
  &[disabled],
  fieldset[disabled] & {}

  &.plg_system_webauthn_login_button {
    align-items: center;
    background: @brand-secondary;
    border-color: @brand-secondary;
    color: lighten(@brand-secondary, 100%);
    display: flex;
    justify-content: center;
    gap: @grid-gutter-width/4;
    width: 100%;

    svg {
      fill: lighten(@brand-secondary, 100%);
      width: 24px;
    }
  }
}


// Alternate buttons
// --------------------------------------------------
.btn-default {

  &:hover,
  &:active,
  &:focus {
    border-color: @btn-default-border;
  }
}

.btn-primary {}

.btn-second {
  background: @brand-secondary;
  color: @white;

  &:hover,
  &:active,
  &:focus {
    background: darken(@brand-secondary, 10%);
    color: @white;
  }
}

// Warning appears as orange
.btn-warning {}

// Danger and error appear as red
.btn-danger {}

// Success appears as green
.btn-success {}

// Info appears as blue-green
.btn-info {}

// T3 Note: Inverse appears as dark-grey
.btn-inverse {
  .button-variant(@btn-inverse-color; @btn-inverse-bg; @btn-inverse-border);
}


// Link buttons
// --------------------------------------------------
// Make a button look and behave like a link
.btn-link {
  color: @link-color;
  text-transform: uppercase;
  padding: 0;
  display: inline;

  &:after {
    content: "\f178";
    display: inline-block;
    font-family: FontAwesome;
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    margin-left: @t3-global-margin/3;
    transition: 0.2s;
  }

  &,
  &:active,
  &[disabled],
  fieldset[disabled] & {}

  &,
  &:hover,
  &:focus,
  &:active {}

  &:hover,
  &:focus {
    color: @link-hover-color;
    text-decoration: none;

    &:after {
      margin-left: @t3-global-margin/2;
    }
  }

  &[disabled],
  fieldset[disabled] & {

    &:hover,
    &:focus {}
  }

}


// Button Sizes
// --------------------------------------------------
.btn-lg {
  font-weight: @font-weight-normal;
  padding-top: @t3-global-padding * 0.75;
  padding-bottom: @t3-global-padding * 0.75;
}

.btn-sm,
.btn-xs,
.btn-small {
  padding: @padding-small-vertical @padding-small-horizontal;
}

.btn-xs {}


// Block button
// --------------------------------------------------
.btn-block {}

// Vertically space out multiple block buttons
.btn-block+.btn-block {
  margin-top: 5px;
}



//
// BUTTON GROUPS (button-groups.less)
// --------------------------------------------------
// T3 Note: See "bootstrap/buttons-group.less"
//  if you want to style this component




// T3 Note: We added legacy form elements to get better
// compatibility with Joomla Core.

// ------------------------------------------------------
// LEGACY FORM ELEMENTS (base-bs3/less/legacy-forms.less)
// ------------------------------------------------------


//
// GENERIC STYLES
// ------------------------------------------------------

// Common form controls
// --------------------

// Legacy class below
select,
textarea,
input[type="text"],
input[type="password"],
input[type="datetime"],
input[type="datetime-local"],
input[type="date"],
input[type="month"],
input[type="time"],
input[type="week"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="color"],
.inputbox {

  // Focus states
  &:focus {}

  // Placeholder
  .placeholder();

  // Disabled and read-only inputs
  &[disabled],
  &[readonly],
  fieldset[disabled] & {}

  // Reset height for `textarea`s
  textarea& {
    height: auto;
  }

  // Reset Width for Legacy classes in Medium Screen
  @media screen and (min-width: @screen-sm) {
    width: auto;
  }

}

// Redefine padding for <select>
select,
select.form-control,
select.inputbox,
select.input {
  padding-right: 5px;
}


// Legacy Input Size
// -------------------
// General classes for quick sizes
.input-mini {}

.input-small {}

.input-medium {}

.input-large {}

.input-xlarge {}

.input-xxlarge {}



// Inline forms
// ------------
.form-inline {}


// Horizontal forms
// ----------------
.form-horizontal {}



//
// OTHER LEGACY CLASSES FROM BS2
// ------------------------------------------------------

// FORM ACTIONS
// ------------
// Adding the legacy "form-actions" from BS2
.form-actions {}


// INPUT GROUPS
// ------------
// Allow us to put symbols and text within the input field for a cleaner look
.input-append,
.input-prepend {

  input,
  select,
  .uneditable-input {

    // Focus state
    &:focus {}
  }

  .add-on {}

  .active {
    background-color: lighten(@green, 30);
    border-color: @green;
  }

}

.input-prepend {

  .add-on,
  .btn {}

  .add-on:first-child,
  .btn:first-child {}

}

.input-append {

  input,
  select,
  .uneditable-input {}

  .add-on,
  .btn,
  .btn-group {}

  .add-on:last-child,
  .btn:last-child,
  .btn-group:last-child>.dropdown-toggle {}

}


.input-prepend.input-append {

  input,
  select,
  .uneditable-input {}

  .add-on:first-child,
  .btn:first-child {}

  .add-on:last-child,
  .btn:last-child {}

  .btn-group:first-child {}

}



//
// BUTTONS
// ------------------------------------------------------

// Lagacy Button Sizes
// --------------------------------------------------

// Large
.btn-large {}

.btn-large [class^="icon-"],
.btn-large [class*=" icon-"] {}

// Small
.btn-small {}

.btn-small [class^="icon-"],
.btn-small [class*=" icon-"] {}


// Mini
.btn-mini {}

.btn-mini [class^="icon-"],
.btn-mini [class*=" icon-"] {}




//
// FORM VALIDATION
// -------------------------------------------------------

// Invalid
// -----------------------
.invalid {
  border-color: @red;
}

label.invalid {
  color: @red;
}

input.invalid {
  border: 1px solid @red;
}