:root {
  --bg-app: #f4f6f8;
  --surface: #ffffff;
  --surface-input: #ffffff;
  --brand: #7c91a1;
  --brand-hover: #677b8b;
  --text-main: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --error: #c87a7a;
  --success: #6e9f85;
  --radius-lg: 12px;
  --radius-md: 6px;
  --shadow-box: 0 10px 30px rgba(13, 20, 31, 0.06), 0 1px 3px rgba(0, 0, 0, 0.02);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

@font-face {
  font-family: 'Inter';
  src: url('Inter.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.85rem;
  background-color: var(--bg-app);
  background-image: radial-gradient(circle at 50% 40%, rgba(124, 145, 161, 0.04) 0%, transparent 60%);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

#loginBox {
  background: var(--surface);
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-box);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 360px;
  animation: fadeIn 0.4s var(--ease);
}

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

.logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.logo-row img {
  width: 45%;
  height: auto;
  object-fit: contain;
}

.logo-divider {
  width: 1px;
  height: 16px;
  background: var(--border);
}

.login-subtitle {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: -14px;
  margin-bottom: 20px;
}

.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

input[type="email"], input[type="password"], input[type="text"] {
  width: 100%;
  padding: 10px;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-input);
  color: var(--text-main);
  transition: all 0.15s var(--ease);
}

@media (min-width: 768px) {
  input[type="email"], input[type="password"], input[type="text"] {
    font-size: 0.8rem;
  }
}

input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124, 145, 161, 0.15);
}

button {
  width: 100%;
  padding: 11px;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(124, 145, 161, 0.15);
  transition: all 0.15s var(--ease);
  margin-top: 4px;
  min-height: 40px;
}

button:hover { background: var(--brand-hover); }
button:active { transform: scale(0.99); }

.auth-error {
  color: #8e3f3f;
  background: rgba(200, 122, 122, 0.1);
  border: 1px solid rgba(200, 122, 122, 0.2);
  text-align: center;
  margin-top: 14px;
  font-size: 0.75rem;
  padding: 10px;
  border-radius: var(--radius-md);
  font-weight: 500;
  display: none;
}

.auth-error:not(:empty) {
  display: block;
  animation: shake 0.35s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
  40%, 60% { transform: translate3d(3px, 0, 0); }
}

.auth-success {
  color: #3b634f;
  background: rgba(110, 159, 133, 0.1);
  border: 1px solid rgba(110, 159, 133, 0.2);
  text-align: center;
  margin-top: 14px;
  font-size: 0.75rem;
  padding: 10px;
  border-radius: var(--radius-md);
  font-weight: 500;
  display: none;
}

.auth-success:not(:empty) { display: block; }

.auth-links {
  text-align: center;
  margin-top: 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.auth-links + .auth-links { margin-top: 8px; }

.auth-links a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

.auth-links a:hover { text-decoration: underline; }
