:root {
  --auth-bg: #f3f8fd;
  --auth-surface: #ffffff;
  --auth-border: #dbe8f4;
  --auth-text: #0f2740;
  --auth-soft: #516478;
  --auth-primary: #0f8b8d;
  --auth-primary-dark: #0b6e6f;
  --auth-shadow: 0 18px 48px rgba(15, 39, 64, 0.12);
  --auth-radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  color: var(--auth-text);
  background:
    radial-gradient(circle at top left, rgba(15, 139, 141, 0.08), transparent 34%),
    linear-gradient(180deg, #f8fbff 0%, var(--auth-bg) 100%);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.auth-shell {
  width: min(460px, 100%);
}

.auth-shell-wide {
  width: min(760px, 100%);
}

.auth-card {
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
  padding: 1.6rem;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  margin-bottom: 1rem;
}

.auth-brand img {
  height: 34px;
  width: auto;
}

.auth-title {
  margin: 0;
  font-size: 1.58rem;
  line-height: 1.2;
}

.auth-subtitle {
  margin: 0.55rem 0 0;
  color: var(--auth-soft);
  line-height: 1.6;
  font-size: 0.95rem;
}

.auth-form {
  margin-top: 1.2rem;
  display: grid;
  gap: 0.9rem;
}

.auth-field {
  display: grid;
  gap: 0.45rem;
}

.auth-field label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #1f3851;
}

.auth-input-wrap {
  position: relative;
}

.auth-input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #c6d7e8;
  border-radius: 12px;
  padding: 0.72rem 0.86rem;
  font-size: 0.95rem;
  color: var(--auth-text);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.auth-input:focus {
  border-color: #48a7d4;
  box-shadow: 0 0 0 3px rgba(72, 167, 212, 0.18);
}

.auth-input.is-invalid {
  border-color: #d2536e;
  box-shadow: 0 0 0 3px rgba(210, 83, 110, 0.14);
}

.auth-inline-btn {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #3f5f7f;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 34px;
  padding: 0 0.55rem;
}

.auth-inline-btn:hover {
  color: var(--auth-primary-dark);
}

.auth-error {
  margin: 0;
  color: #c43e5a;
  font-size: 0.8rem;
  min-height: 1.1rem;
}

.auth-alert {
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  font-size: 0.88rem;
  margin-top: 0.8rem;
  line-height: 1.5;
}

.auth-alert.is-error {
  background: rgba(212, 68, 96, 0.1);
  border: 1px solid rgba(212, 68, 96, 0.26);
  color: #912640;
}

.auth-alert.is-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.22);
  color: #0f6c55;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 0.4rem;
}

.auth-link {
  color: #2f67a5;
  text-decoration: none;
  font-size: 0.86rem;
}

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

.auth-btn {
  border: 0;
  border-radius: 12px;
  min-height: 46px;
  padding: 0 1rem;
  background: linear-gradient(135deg, var(--auth-primary) 0%, #0ca4a7 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.93rem;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
  box-shadow: 0 10px 26px rgba(15, 139, 141, 0.22);
}

.auth-btn:hover {
  transform: translateY(-1px);
}

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

.auth-btn.is-loading {
  position: relative;
  color: transparent;
}

.auth-btn.is-loading::after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: -8px;
  margin-top: -8px;
  animation: auth-spin 0.7s linear infinite;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  color: #304e6e;
}

.auth-help {
  margin-top: 1rem;
  color: var(--auth-soft);
  font-size: 0.84rem;
  line-height: 1.5;
}

.auth-meter {
  margin-top: 0.15rem;
}

.auth-meter-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e6eef6;
  overflow: hidden;
}

.auth-meter-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.2s ease, background-color 0.2s ease;
}

.auth-meter-text {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #516478;
}

.auth-panel {
  margin-top: 1rem;
  border-top: 1px solid #e4edf6;
  padding-top: 1rem;
}

.auth-center {
  text-align: center;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.2rem;
  }

  .auth-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-btn {
    width: 100%;
  }
}
