/* Home and the login form (view.php hauptView() and loginView()). index.php links this file only on those two pages,
   which also get the viewport meta and the .mobile-ready foundation of css/style.css. Desktop keeps the plain look it
   always had; phones, upright and on their side, get the layout in the media query below. Values from the
   Verwaltung Digital design system (tokens.json), the same as Meine Zeiterfassung (part 2 of zeiterfassung/style.css): PageTitle, Button. */
.page-home body {
  --pantone-320: #009ca6;
  --pantone-320-dark: #007a83;
  --pantone-320-deep: #00656c;
  --pantone-320-tint: #e6f5f6;
  --dunkelgrau: #333132;
  --button-text: #000000;
  --white: #ffffff;
  --grey-300: #b9bab1;
  --grey-400: #86877e;
  --grey-600: #5f6058;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --radius-sm: 2px;
  --radius-md: 4px;
  --shadow-press: 0 1px 0 0 #333132;
  --touch: 44px;
}

/* ---------- desktop: the list of links it always was ---------- */
.home__actions {
  list-style: none;
}

/* .home in front: the Material Icons stylesheet loads later and sets display: inline-block */
.home .home__icon,
.home__account-title {
  display: none;
}

/* A button.plainButton: "button." keeps this rule level with it, and home.css loads after css/style.css */
button.home__more {
  cursor: pointer;
  color: blue;
}

/* ---------- phones: portrait up to 700px, landscape up to 960px wide when no more than 500px tall ---------- */
@media (max-width: 700px), (max-width: 960px) and (max-height: 500px) {
  .page-home body > div:first-child img {
    max-width: 180px;
    height: auto;
  }

  /* The tiles below are the menu on Home: the bar keeps only the user and "Abmelden". The " | " separators are bare
     text, so the bar's font size hides them and the user span sets its own. */
  .page-home .menu {
    display: block;
    padding: var(--space-2);
    font-size: 0;
    line-height: 0;
  }

  .page-home .menu > a {
    display: none;
  }

  .page-home .menu > span[style*="float"] {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    float: none !important;
    font-size: 16px;
    line-height: 20px;
  }

  .page-home .menu__user {
    flex: 1 1 160px;
    min-width: 0;
    padding-left: var(--space-1);
    overflow-wrap: anywhere;
  }

  /* Button */
  .page-home .menu a[href="?logout"] {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch);
    padding: 0 var(--space-4);
    font-size: 15px;
    line-height: 20px;
    font-weight: 700;
    color: var(--button-text);
    text-decoration: none;
    background: var(--pantone-320);
    border: 1px solid var(--dunkelgrau);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-press);
    touch-action: manipulation;
  }

  .page-home .menu a[href="?logout"]:active {
    background: var(--pantone-320-deep);
    box-shadow: none;
  }

  .page-home .menu a[href="?logout"]:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 2px;
  }

  .home,
  .login__title,
  .login {
    color: var(--dunkelgrau);
    font-family: Roboto, "Segoe UI", Arial, sans-serif;
  }

  .home *,
  .login * {
    box-sizing: border-box;
  }

  /* Greeting first, then the actions, then the account facts */
  .home {
    display: flex;
    flex-direction: column;
    padding: var(--space-4) 0 var(--space-6);
  }

  /* PageTitle */
  .home__title,
  .login__title {
    position: relative;
    order: 0;
    margin: 0;
    padding-left: 18px; /* heading-bar-width 6px + space-3 */
    font-size: 28px;
    line-height: 34px;
    font-weight: 900;
    color: var(--pantone-320);
    overflow-wrap: anywhere;
  }

  .home__title::before,
  .login__title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 6px;
    background: var(--pantone-320);
  }

  .home__prompt {
    order: 1;
    margin-top: var(--space-1);
    padding-left: 18px;
    font-size: 18px;
    line-height: 24px;
    font-weight: 300;
  }

  .home__prompt br,
  .home__email br,
  .home__rule {
    display: none;
  }

  /* One column upright, two or three on the side */
  .home__actions {
    order: 2;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: var(--space-2);
    margin: var(--space-5) 0 0;
    padding: 0;
  }

  .home__action {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    height: 100%;
    min-height: 56px;
    padding: var(--space-2) var(--space-3) var(--space-2) var(--space-4);
    font-size: 16px;
    line-height: 20px;
    font-weight: 500;
    color: var(--dunkelgrau);
    text-decoration: none;
    background: var(--white);
    border: 1px solid var(--grey-300);
    border-radius: var(--radius-md);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .home__action::after {
    content: "chevron_right";
    margin-left: auto;
    font-family: "Material Icons", sans-serif;
    font-size: 24px;
    line-height: 1;
    font-feature-settings: "liga";
    -webkit-font-smoothing: antialiased;
    color: var(--grey-600);
  }

  .home__action:hover,
  .home__action:active {
    background: var(--pantone-320-tint);
    border-color: var(--pantone-320-dark);
  }

  .home__action:focus-visible {
    outline: 2px solid var(--pantone-320-dark);
    outline-offset: 2px;
  }

  /* Meine Zeiterfassung and Eigenes Profil: the two pages built for phones */
  .home__action--primary {
    min-height: 64px;
    padding-left: var(--space-3);
    font-weight: 700;
    border-left: 6px solid var(--pantone-320);
  }

  .home .home__icon {
    display: inline-block;
    flex: none;
    font-size: 24px;
    color: var(--pantone-320-dark);
  }

  .home__label {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .home__account {
    order: 3;
    margin-top: var(--space-6);
    padding: var(--space-4);
    font-size: 14px;
    line-height: 20px;
    border: 1px solid var(--grey-300);
    border-radius: var(--radius-md);
    overflow-wrap: anywhere;
  }

  .home__account-title {
    display: block;
    margin: 0 0 var(--space-3);
    font-size: 22px;
    line-height: 28px;
    font-weight: 700;
    color: var(--pantone-320);
  }

  .home__right + .home__right {
    margin-top: var(--space-2);
  }

  .home__email {
    margin-top: var(--space-3);
  }

  .home__account-title + .home__email {
    margin-top: 0;
  }

  /* A bigger touch target that does not push the lines apart */
  button.home__more {
    display: inline-block;
    margin: calc(-1 * var(--space-2)) 0;
    padding: var(--space-2) var(--space-1);
    color: var(--pantone-320-dark);
    text-decoration: underline;
  }

  /* ---------- login: labels above full-width fields ---------- */
  .login__title {
    margin: var(--space-4) 0 var(--space-5);
  }

  .login {
    max-width: 480px;
  }

  .mobile-ready .login__table,
  .login__table tbody,
  .login__table tr,
  .login__table td {
    display: block;
    width: 100%;
    overflow: visible;
    padding: 0;
  }

  .login__table tr + tr {
    margin-top: var(--space-4);
  }

  .login__table td:empty {
    display: none;
  }

  .login label {
    display: block;
    margin-bottom: var(--space-1);
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
  }

  /* 16px keeps iOS from zooming into the field */
  .login input[type="text"],
  .login input[type="password"] {
    width: 100%;
    min-height: var(--touch);
    padding: var(--space-2) var(--space-3);
    font: 16px/24px Roboto, "Segoe UI", Arial, sans-serif;
    color: var(--dunkelgrau);
    border: 1px solid var(--grey-400);
    border-radius: var(--radius-sm);
  }

  .login input[type="text"]:focus-visible,
  .login input[type="password"]:focus-visible {
    outline: 2px solid var(--pantone-320-dark);
    outline-offset: 2px;
  }

  /* Button */
  .login input[type="submit"] {
    width: 100%;
    min-height: 48px;
    margin-top: var(--space-2);
    font: 700 15px/20px Roboto, "Segoe UI", Arial, sans-serif;
    color: var(--button-text);
    background: var(--pantone-320);
    border: 1px solid var(--dunkelgrau);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-press);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-appearance: none;
    appearance: none;
  }

  .login input[type="submit"]:active {
    background: var(--pantone-320-deep);
    box-shadow: none;
    transform: translateY(1px);
  }
}

/* Landscape phones: the login form side by side would not help, but less space above it does */
@media (max-width: 960px) and (max-height: 500px) {
  .page-home body > div:first-child img {
    max-width: 150px;
  }

  .home {
    padding-top: var(--space-2);
  }

  .login__title {
    margin: var(--space-2) 0 var(--space-4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .login input[type="submit"]:active {
    transform: none;
  }
}
