@import url("https://fonts.googleapis.com/css2?family=Lexend:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f4f7fb;
  --card-bg: #ffffff;
  --text: #1e2a3a;
  --line: #d7deea;
  --accent: #0058a3;
  --accent-hover: #00457f;
  --error-bg: #fff1f1;
  --error-text: #b42318;
  --top-logo-width: clamp(70px, 7.5vw, 90px);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body.auth-page {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(14px, 2.8vw, 24px);
  font-family: "Lexend", Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, #e7effa 0%, transparent 42%),
    radial-gradient(circle at 90% 100%, #e8f3ff 0%, transparent 40%),
    var(--bg);
}

.auth-card {
  width: min(100%, 560px);
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 36px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(12, 41, 77, 0.08);
  padding: clamp(18px, 2.8vw, 28px);
  padding-top: clamp(10px, 1.6vw, 16px);
}

.brand-logo {
  width: var(--top-logo-width);
  height: auto;
  display: block;
  margin-top: clamp(0px, 0.5vh, 4px);
  margin-bottom: 8px;
}

h1 {
  margin: 0 0 20px;
  font-size: clamp(25px, 3.6vw, 31px);
  font-weight: 700;
  line-height: 1.12;
  display: block;
  padding-bottom: 0.06em;
  color: var(--text);
}

.field {
  margin-bottom: 14px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: clamp(17px, 2.4vw, 19px);
  font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"] {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  font-size: clamp(17px, 2.2vw, 18px);
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="file"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 88, 163, 0.16);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
}

button {
  margin-top: 28px;
  width: 320px;
  max-width: 100%;
  min-height: 46px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(
    102deg,
    #ffd200 0%,
    #ffb800 12%,
    #ff8a00 24%,
    #ff5b00 35%,
    #e02020 47%,
    #b0007a 60%,
    #6a1bb1 71%,
    #0b72b9 84%,
    #0ca0c8 92%,
    #0aa85a 100%
  );
  color: #fff;
  font-size: clamp(17px, 2.2vw, 18px);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(12, 41, 77, 0.2);
}

button:hover {
  filter: brightness(0.92);
}

.msg {
  margin-top: 14px;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
}

.msg-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 0;
  margin-bottom: 14px;
  min-height: 52px;
}

.top-row .brand-logo {
  margin-top: 0;
  margin-bottom: 0;
}

.logout-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.logout-link:hover {
  text-decoration: underline;
}

a {
  color: #0b2a57;
}

a:hover {
  color: #061c3f;
}

@media (min-width: 768px) and (max-width: 1366px) {
  .auth-card {
    width: min(100%, 760px);
  }
}

@media (min-width: 768px) and (orientation: portrait) {
  body.auth-page {
    place-items: center;
    padding: 22px;
  }

  .auth-card {
    width: min(100%, 680px);
  }
}

@media (min-width: 900px) and (orientation: landscape) {
  body.auth-page {
    place-items: start center;
    padding: 16px 28px;
  }

  .auth-card {
    width: min(100%, 940px);
  }
}

@media (min-width: 768px) and (max-height: 820px) {
  body.auth-page {
    place-items: start center;
    padding: 8px 12px;
  }

  .auth-card {
    padding: 16px 14px 10px;
    border-radius: 12px;
  }

  .brand-logo {
    display: block;
    width: 64px;
    margin-bottom: 4px;
  }

  .top-row {
    margin-bottom: 16px;
    min-height: 24px;
    align-items: center;
  }

  .logout-link {
    font-size: 12px;
    gap: 4px;
  }

  .logout-link span {
    display: inline;
  }

  .field {
    margin-bottom: 8px;
  }

  label {
    margin-bottom: 4px;
    font-size: 16px;
  }

  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="date"] {
    min-height: 40px;
    font-size: 16px;
  }

  button {
    margin-top: 14px;
    min-height: 40px;
  }
}
