@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --error: #b3122f;
  --blue-1: #7399cf;
  --blue-2: #3f609c;
  --glass: rgba(255, 255, 255, 0.18);
  --glass-border: rgba(255, 255, 255, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: #121212;
  color: #fff;
  font-family: 'Inter', sans-serif;
}

button,
input {
  font: inherit;
}

/* ============ APP + VIEWS ============ */

.app {
  position: relative;
  overflow: hidden;
  width: min(100%, 430px);
  height: min(100dvh, 932px);
  background: url('assets/images/background-image.png') center / cover no-repeat;
}

.view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 86px 56px 32px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateX(24px);
  transition: opacity 0.35s, transform 0.35s, visibility 0s linear 0.35s;
}

.view.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

h1 {
  margin-bottom: 56px;
  font-size: 26px;
  font-weight: 700;
}

form {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* ============ FIELDS ============ */

.group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 29px;
}

label {
  font-size: 12px;
  font-weight: 500;
}

.field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field:focus-within {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

/* ============ ERRORS ============ */

.error,
.form-error {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  color: var(--error);
  font-size: 11px;
  font-weight: 500;
  transition: max-height 0.25s, opacity 0.25s, margin 0.25s;
}

.has-error .error {
  max-height: 40px;
  opacity: 1;
}

.form-error.is-visible {
  max-height: 24px;
  margin-bottom: 8px;
  opacity: 1;
}

.has-error .field {
  border-color: var(--error);
}

.has-error .icon {
  color: var(--error);
  opacity: 1;
}

.shake {
  animation: shake 0.35s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ============ BUTTONS ============ */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 14px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.2s, transform 0.1s, background-color 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  margin-top: 33px;
  background: linear-gradient(90deg, var(--blue-1), var(--blue-2));
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-glass {
  margin-top: 50px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 14px;
  font-weight: 500;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.28);
}

.btn-glass svg {
  width: 16px;
  height: 16px;
}

/* ============ LINKS ============ */

.switch,
.forgot {
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.switch {
  margin-top: 12px;
}

.switch-first {
  margin-top: 65px;
}

.forgot {
  margin-top: 81px;
  color: #fff;
  text-decoration: none;
}

.forgot:hover,
.link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link {
  background: none;
  border: none;
  color: #111;
  font-weight: 700;
  cursor: pointer;
}

/* ============ TOAST ============ */

.toast {
  position: absolute;
  left: 50%;
  bottom: 28px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: opacity 0.3s, transform 0.3s;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}