/* Login Dialog */

.login-dialog-banner-view {
  padding-top: 24px;
  max-width: 23em;
}

.login-dialog,
.unlock-dialog {
  //reset
  border: none;
  background-color: transparent;

  $_gdm_bg: $base_color; // Yaru change: use $base_color for dark/light theme switch

  .modal-dialog-button-box { spacing: 3px; }
  .modal-dialog-button {
    padding: 4px 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    background-color: $_gdm_bg; // Yaru change: use $_gdm_bg
    border-color: $borders_color; // Yaru change: use $borders_color
    color: $fg_color; // Yaru change: use $fg_color for dark/light theme

    $_hover_c: if($variant == 'light', darken($_gdm_bg, 15%), lighten($_gdm_bg, 5%)); // Yaru change: use $_gdm_bg and modify light theme background

    // &:hover, &:focus { // Yaru: no need to change background on focus thanks to focus ring
    &:hover {
      background-color: $_hover_c;
      // border-color: $_hover_c; // Yaru: don't overwrite border on hover
    }
    &:focus { // Yaru: add focus ring
      border-color: $focus_border_color;
      box-shadow: inset 0 0 0 1px $focus_border_color;
    }
    &:active {
      $_active_c: if($variant == 'light', darken($_gdm_bg, 25%), darken($_gdm_bg, 5%)); // Yaru: adapt active color
      box-shadow: none;
      background-color: $_active_c;
      color: transparentize($osd_fg_color, 0.3);
    }
    &:default {
      @include button(default, $c:$suggested_bg_color, $tc:$selected_fg_color);
    }
  }

  .cancel-button,
  .switch-user-button,
  .login-dialog-session-list-button {
    padding: 0;
    border-radius: 99px;
    width: $large_icon_size;
    height: $large_icon_size;
    // border-color: darken($system_bg_color, 3%);  // Yaru change: don't overwrite button look
    // background-color: darken($system_bg_color, 3%);  // Yaru change: don't overwrite button look

    StIcon { icon-size: $base_icon_size; }
  }

  .caps-lock-warning-label,
  .login-dialog-message { // Yaru: we want all login messages to use OSD fg color
    color: $osd_fg_color;
  }
}

.login-dialog-logo-bin { padding: 24px 0px; }
.login-dialog-banner { color: darken($osd_fg_color,10%); }
.login-dialog-button-box { width: 23em; spacing: 5px; }
.login-dialog-message { text-align: center; }
.login-dialog-user-selection-box { padding: 100px 0px; }
.login-dialog-not-listed-label {
  padding-left: 2px;
  .login-dialog-not-listed-button:focus &,
  .login-dialog-not-listed-button:hover & {
    color: $osd_fg_color;
  }
}

.login-dialog-not-listed-label {
  @extend %caption;
  font-weight: bold;
  color: darken($osd_fg_color,30%);
  padding-top: 1em;
}

.login-dialog-auth-list-view { -st-vfade-offset: 1em; }
.login-dialog-auth-list {
  spacing: 6px;
  margin-left: 2em;
}

.login-dialog-auth-list-title {
  margin-left: 2em;
}

.login-dialog-auth-list-item {
  border-radius: $base_border_radius + 4px;
  padding: 6px;
  color: darken($osd_fg_color,30%);
  &:focus, &:selected { background-color: $selected_bg_color; color: $selected_fg_color; }
}

.login-dialog-auth-list-label {
  @include fontsize($base_font_size + 2);
  font-weight: bold;
  padding-left: 15px;

  &:ltr { padding-left: 14px; text-align: left; }
  &:rtl { padding-right: 14px; text-align: right; }
}

.login-dialog-user-list-view { -st-vfade-offset: 1em; }
.login-dialog-user-list { // Yaru: we want the gray hover to work on GDM, thus the transparentized fg color
  spacing: 12px;
  width: 23em;
  &:expanded .login-dialog-user-list-item:selected { background-color: transparentize($selected_fg_color, 0.9); color: $selected_fg_color; }
  &:expanded .login-dialog-user-list-item:logged-in { border-right: 2px solid transparentize($selected_fg_color, 0.9); }
}

.login-dialog-user-list-item {
  border-radius: $base_border_radius + 4px;
  padding: 6px;
  color: darken($osd_fg_color,30%);
  &:ltr .user-widget { padding-right: 1em; }
  &:rtl .user-widget { padding-left: 1em; }
  .login-dialog-timed-login-indicator {
    height: 2px;
    margin-top: 6px;
    background-color: $osd_fg_color;
  }
  &:focus .login-dialog-timed-login-indicator { background-color: $selected_fg_color; }
}

.user-widget-label {
  color: $osd_fg_color;
}

.user-widget.horizontal .user-widget-label {
  @include fontsize($base_font_size + 2);
  font-weight: bold;
  padding-left: 15px;

  &:ltr { padding-left: 14px; text-align: left; }
  &:rtl { padding-right: 14px; text-align: right; }
}

.user-widget.vertical .user-widget-label {
  @include fontsize($base_font_size + 5);
  text-align: center;
  font-weight: normal;
  padding-top: 16px;
}

.login-dialog-timed-login-indicator {
    height: 2px;
    background-color: darken($fg_color,40%);
}

.login-dialog-prompt-layout {
  padding-top: 24px;
  padding-bottom: 12px;
  spacing: $base_padding * 2;
  width: 23em;
}

.login-dialog-prompt-entry {
  height: 1.5em;
}

.login-dialog-prompt-label {
  color: darken($osd_fg_color, 20%);
  @include fontsize($base_font_size + 1);
  padding-top: 1em;
}

.login-dialog {
  StEntry {
    @if $variant=='dark' {
      $_gdm_entry_bg: darken($system_bg_color, 3%);
      background-color: $_gdm_entry_bg;
      color: $fg_color;
    }
  }
}

// Custom styling for unlock entry
.unlock-dialog {
  StEntry {
    border:none !important;
    &, &:focus { // Yaru change: also style unfocused state
      background-color: transparentize($fg_color, 0.9);
      box-shadow: none; // Yaru change: remove box-shadow because of ugly render
    }
    &:insensitive { 
      color: transparentize($fg_color, 0.5);
      background-color: transparentize($fg_color, 0.95);
    }
  }

  .cancel-button,
  .switch-user-button,
  .login-dialog-session-list-button {
    border-color: transparent;
    background-color: transparentize($fg_color, 0.9);
  }
}
