/* Login page of travelynx.tastetwist.de - a 1:1 copy of the TasteTwist login
 * (Frontend/src/app/authentification/login) built from the same pieces:
 * tokens (styles/_tokens.scss), tt-field, tt-button, tt-toast and the base
 * rules Bootstrap's reboot gives the Angular app. Keep in sync by hand. */

:root {
  --tt-color-primary: #007a6c;
  --tt-color-secondary: #84b4aa;
  --tt-color-success: #8aca8a;
  --tt-color-danger: #7a000e;
  --tt-color-card: #ffffff;
  --tt-color-text: #14433c;
  --tt-color-text-muted: rgb(20 67 60 / 70%);
  --tt-color-text-subtle: rgb(20 67 60 / 55%);
  --tt-color-text-on-dark: #ffffff;
  --tt-color-line-strong: rgb(132 180 170 / 100%);

  --tt-gradient: linear-gradient(to right, #276d7c, #9cc3bb);
  --tt-gradient-diagonal: linear-gradient(121.64deg, #276d7c 14%, #9cc3bb 86%);

  --tt-font-sans: Roboto, "Helvetica Neue", sans-serif;
  --tt-font-condensed: "Roboto Condensed", Roboto, sans-serif;

  --tt-size-h1: 2rem;
  --tt-size-h3: 1.25rem;
  --tt-size-body: 1rem;
  --tt-size-small: 0.875rem;
  --tt-size-label: 0.8125rem;

  --tt-leading-tight: 1.2;
  --tt-leading-body: 1.6;
  --tt-tracking-label: 0.06em;

  --tt-space-2: 8px;
  --tt-space-3: 12px;
  --tt-space-4: 16px;
  --tt-space-5: 24px;
  --tt-space-6: 32px;

  --tt-radius-control: 10px;
  --tt-shadow-card: 0 1px 2px rgb(20 67 60 / 6%), 0 8px 24px -4px rgb(20 67 60 / 9%);

  --tt-appbar-height: 72px;
  --tt-tabbar-height: 64px;
}

@media (max-width: 767.98px) {
  :root {
    --tt-size-h1: 1.625rem;
  }
}

/* --- Base (styles.scss + Bootstrap reboot) --- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Roboto, "Helvetica Neue", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: #212529;
  background-color: #cde1dc;
  -webkit-text-size-adjust: 100%;
}

input,
button {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* --- Login (login-form.component.scss) --- */

.login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: var(--tt-space-4);
  background: var(--tt-gradient);
}

.login__card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 440px;
  margin: 0;
  padding: 40px 40px var(--tt-space-6);
  border-radius: 20px;
  background: var(--tt-color-card);
  box-shadow: var(--tt-shadow-card);
}

.login__brand {
  display: flex;
  align-self: center;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--tt-color-text);
}

.login__logo {
  border-radius: 8px;
  object-fit: cover;
}

.login__title {
  margin: 28px 0 0;
  text-align: center;
  font-size: var(--tt-size-h1);
  font-weight: 700;
  line-height: var(--tt-leading-tight);
  letter-spacing: -0.015em;
  color: var(--tt-color-text);
}

.login__lead {
  margin: var(--tt-space-2) 0 0;
  text-align: center;
  font-size: var(--tt-size-body);
  line-height: var(--tt-leading-body);
  color: var(--tt-color-text-muted);
}

.login__field--username {
  margin-top: 28px;
}

.login__field--password {
  margin-top: var(--tt-space-4);
}

.login__submit {
  margin-top: var(--tt-space-5);
}

.login__back {
  align-self: center;
  margin-top: 20px;
}

.login__password {
  position: relative;
}

.login__password input {
  padding-right: 44px;
}

.login__reveal {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: inline-flex;
  padding: 6px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--tt-color-text-muted);
  cursor: pointer;
}

.login__reveal:focus-visible {
  outline: 2px solid var(--tt-color-primary);
  outline-offset: 1px;
}

@media (max-width: 767.98px) {
  .login {
    background: var(--tt-gradient-diagonal);
  }

  .login__card {
    padding: var(--tt-space-6) var(--tt-space-5) 26px;
  }

  .login__brand {
    gap: 9px;
    font-size: 17px;
  }

  .login__logo {
    width: 30px;
    height: 30px;
  }

  .login__title {
    margin-top: 22px;
  }

  .login__lead {
    margin-top: 6px;
    font-size: var(--tt-size-small);
    line-height: 1.55;
  }

  .login__field--username {
    margin-top: var(--tt-space-5);
  }

  .login__field--password {
    margin-top: 14px;
  }

  .login__submit {
    margin-top: 22px;
  }

  .login__back {
    margin-top: var(--tt-space-4);
  }

  .login__submit.btn {
    padding: 15px var(--tt-space-5);
    font-size: var(--tt-size-h3);
    font-weight: 700;
  }
}

/* --- tt-field (ui/field) --- */

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field__label {
  font-family: var(--tt-font-condensed);
  font-size: var(--tt-size-label);
  font-weight: 700;
  letter-spacing: var(--tt-tracking-label);
  line-height: 1.35;
  color: var(--tt-color-text-muted);
}

.field__control input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--tt-color-line-strong);
  border-radius: var(--tt-radius-control);
  background: var(--tt-color-card);
  color: var(--tt-color-text);
  font-family: var(--tt-font-sans);
  font-size: var(--tt-size-body);
  line-height: 1.5;
}

.field__control input:focus-visible {
  outline: 2px solid var(--tt-color-primary);
  outline-offset: 1px;
}

.field--invalid .field__control input {
  border-color: var(--tt-color-danger);
}

.field__error {
  margin: 0;
  color: var(--tt-color-danger);
  font-size: var(--tt-size-small);
  line-height: 1.55;
}

.field__error[hidden] {
  display: none;
}

/* --- tt-button (ui/button) --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--tt-space-2);
  border: 1px solid transparent;
  border-radius: var(--tt-radius-control);
  font-family: var(--tt-font-sans);
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
}

.btn:focus-visible {
  outline: 2px solid var(--tt-color-primary);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn--s {
  padding: 7px 14px;
  font-size: var(--tt-size-small);
}

.btn--l {
  padding: 14px 28px;
  font-size: var(--tt-size-body);
  border-radius: 12px;
}

.btn--primary {
  background: var(--tt-color-primary);
  color: var(--tt-color-text-on-dark);
}

.btn--ghost {
  background: none;
  color: var(--tt-color-primary);
}

@media (prefers-reduced-motion: no-preference) {
  .btn {
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
  }
}

/* --- tt-toast (ui/toast) in the layer of app-alert --- */

.toast-layer {
  position: fixed;
  top: calc(var(--tt-appbar-height) + var(--tt-space-4));
  right: var(--tt-space-4);
  z-index: 20;
  width: 380px;
  max-width: calc(100vw - 2 * var(--tt-space-4));
}

@media (max-width: 767.98px) {
  .toast-layer {
    top: auto;
    left: var(--tt-space-4);
    right: var(--tt-space-4);
    width: auto;
    bottom: calc(var(--tt-tabbar-height) + env(safe-area-inset-bottom) + var(--tt-space-4));
  }
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--tt-space-3);
  overflow: hidden;
  padding: 14px 12px 14px 0;
  border-radius: 12px;
  background: var(--tt-color-card);
  box-shadow: var(--tt-shadow-card);
}

.toast__spine {
  flex: 0 0 4px;
  align-self: stretch;
}

.toast--error .toast__spine {
  background: var(--tt-color-danger);
}

.toast__icon {
  flex: 0 0 auto;
  margin-left: 10px;
}

.toast--error .toast__icon {
  color: var(--tt-color-danger);
}

.toast__message {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: var(--tt-size-body);
  line-height: var(--tt-leading-body);
  color: var(--tt-color-text);
}

.toast__close {
  flex: 0 0 auto;
  display: inline-flex;
  padding: 6px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--tt-color-text-subtle);
  cursor: pointer;
}

.toast__close:focus-visible {
  outline: 2px solid var(--tt-color-primary);
  outline-offset: 1px;
}

@keyframes tt-toast-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .toast {
    animation: tt-toast-in 200ms ease-out;
  }
}
