:root {
  --bg1: #ffffff;
  --bg2: #f5fff9;
  --line: #d4e8db;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #34d399;
  --primary-2: #16a34a;
  --yellow: #34d399;
  --ok: #0f8f6a;
  --danger: #ca2b2b;
  --focus: #16a34a;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: #ffffff;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  background-color: #ffffff;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 10% 10%, #d9fbe8 0, transparent 36%),
    radial-gradient(circle at 90% 0%, #c9f7df 0, transparent 38%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 430px;
  border: 0;
  border-radius: 16px;
  padding: 20px;
  background: #ffffff;
  box-shadow: 0 20px 40px rgba(22, 163, 74, 0.1), 0 8px 16px rgba(0, 0, 0, 0.05);
  animation: floatin 360ms ease both;
}


.brand {
  text-align: center;
}

.brand img,
.brand__logo {
  width: min(240px, 82vw);
  height: auto;
  max-height: 52px;
  object-fit: contain;
  border-radius: 12px;
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  animation: logo-bob 3.2s ease-in-out infinite;
}

.brand h1 {
  margin: 10px 0 4px;
  font-size: 1.35rem;
}

.brand p {
  margin: 0;
  color: #9aa3b2;
  font-size: 0.86rem;
  min-height: 2.8em;
  opacity: 1;
  transition: opacity 260ms ease;
}

.brand p.subtitle-fade-out {
  opacity: 0;
}

form {
  margin-top: 12px;
}

.field {
  margin-top: 0;
  position: relative;
}

.field label {
  position: absolute;
  left: 12px;
  top: 14px;
  transform: none;
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.2;
  font-weight: 600;
  pointer-events: none;
  transition: transform 170ms ease, color 170ms ease, font-size 170ms ease, top 170ms ease;
  background: #fff;
  padding: 0 4px;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 12px;
  font: inherit;
  line-height: 1.2;
  color: var(--text);
  background: #fff;
  box-shadow: 0 2px 4px rgba(16, 32, 63, 0.04);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.field input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
  transform: translateY(-0.5px);
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: -7px;
  transform: none;
  color: var(--focus);
  font-size: 0.75rem;
}

.field small {
  min-height: 0.8rem;
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--danger);
}

.field.valid small {
  color: var(--ok);
}

.primary-btn,
.social-btn {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  padding: 12px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.primary-btn {
  margin-top: 8px;
  color: #ffffff;
  background: linear-gradient(145deg, #34d399, var(--primary-2));
  box-shadow: 0 10px 20px rgba(22, 163, 74, 0.32);
  animation: primary-breathe 2.8s ease-in-out infinite;
}

.mode-switch {
  margin: 8px 0 0;
  text-align: center;
}

.mode-switch-btn {
  border: 0;
  background: transparent;
  color: #6b7280;
  font: inherit;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 0;
}

.mode-switch-btn.register-accent {
  color: #4b8f64;
  text-decoration-color: #4b8f64;
  font-weight: 700;
}

.social-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  color: #1f2937;
  text-align: left;
  padding: 11px 12px;
  border-radius: 8px;
  border: 0;
}

.social-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  font-weight: 800;
  flex: 0 0 24px;
}

.social-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.social-text {
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

.social-btn.google {
  background: #ffffff;
  color: #5f6368;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.social-btn.google .social-icon {
  background: #ffffff;
  color: transparent;
  background-image: conic-gradient(
    from 25deg,
    #4285f4 0deg 90deg,
    #34a853 90deg 180deg,
    #fbbc05 180deg 270deg,
    #ea4335 270deg 360deg
  );
  -webkit-background-clip: text;
  background-clip: text;
  border: 0;
}

.social-btn.facebook {
  background: #2d7ef0;
  color: #ffffff;
  border: 0;
  box-shadow: 0 4px 10px rgba(45, 126, 240, 0.32);
}

.social-btn.facebook .social-icon {
  background: transparent;
  color: #ffffff;
  border: 0;
}

.social-btn.apple {
  background: #000000;
  color: #ffffff;
  border: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.24);
}

.social-btn.apple .social-icon {
  background: transparent;
  color: #ffffff;
  border: 0;
}

.primary-btn:hover,
.social-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:active,
.social-btn:active {
  transform: translateY(1px);
}

.divider {
  margin: 10px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.84rem;
}

.status {
  min-height: 1.2rem;
  margin: 2px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.status.ok {
  color: var(--ok);
}

.status.error {
  color: var(--danger);
}

.credits {
  margin: 0;
  text-align: center;
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: #8a8f98;
}

.primary-btn[disabled],
.social-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

:focus-visible {
  outline: none;
}

@keyframes floatin {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes logo-bob {
  0% {
    transform: translateY(0) scale(1);
  }
  35% {
    transform: translateY(-1.5px) scale(1.01);
  }
  50% {
    transform: translateY(0.8px) scale(0.995);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes primary-breathe {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-0.8px) scale(1.01);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 460px) {
  .page {
    padding: 0;
  }

  .auth-card {
    max-width: 100%;
    width: 100%;
    min-height: 100vh;
    padding: 18px 14px;
    border-radius: 0;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
