@font-face {
  font-family: 'Klavika';
  src: url('/fonts/klavika-light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Klavika';
  src: url('/fonts/klavika-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Klavika';
  src: url('/fonts/klavika-medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #006ec7;
  --primary-hover: #0082eb;
  --primary-light: rgba(0, 110, 199, 0.15);
  --text: #f0f4f8;
  --text-secondary: rgba(255, 255, 255, 0.65);
  --card-bg: rgba(10, 18, 30, 0.65);
  --card-border: rgba(255, 255, 255, 0.08);
  --input-bg: rgba(255, 255, 255, 0.07);
  --input-border: rgba(255, 255, 255, 0.15);
  --input-focus-border: #00a2ff;
  --error: #ff6b6b;
  --success: #4caf50;
  --radius: 14px;
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --blur: 20px;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Klavika', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: url('/background.webp') center / cover no-repeat fixed;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 10, 20, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
}

header {
  text-align: center;
  margin-bottom: 32px;
}

.logo {
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.logo:not([hidden]) {
  display: flex;
}

.logo h1 {
  font-size: 2.1rem;
  font-weight: 500;
  color: #fff;
  letter-spacing: -0.01em;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 300;
}

.description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.5;
  margin-bottom: 24px;
}

main {
  background: var(--card-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  color: #fff;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.35);
  font-weight: 300;
}

input:focus {
  border-color: var(--input-focus-border);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(0, 162, 255, 0.15);
}

input.invalid {
  border-color: var(--error);
}

input.invalid:focus {
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

.field-error {
  display: block;
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 4px;
  min-height: 1.2em;
}

.field-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 300;
  text-align: right;
}

button[type="submit"] {
  width: 100%;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.1s, box-shadow 0.15s;
  margin-top: 4px;
}

button[type="submit"]:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 20px rgba(0, 110, 199, 0.35);
}

button[type="submit"]:active {
  transform: scale(0.99);
}

button[type="submit"]:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-block;
  padding: 8px 20px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  background: var(--primary-light);
  border: 1px solid rgba(0, 110, 199, 0.3);
  border-radius: 8px;
  cursor: pointer;
  margin-top: 12px;
  transition: background-color 0.15s;
}

.btn-secondary:hover {
  background: rgba(0, 110, 199, 0.25);
}

.btn-loading {
  align-items: center;
  gap: 8px;
}

.btn-loading:not([hidden]) {
  display: inline-flex;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.result-card {
  text-align: center;
  padding: 8px 0;
}

.result-card h2 {
  font-size: 1.25rem;
  font-weight: 500;
  color: #fff;
  margin-bottom: 8px;
}

.result-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.result-icon {
  margin-bottom: 16px;
}

footer {
  position: fixed;
  bottom: 16px;
  left: 24px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 300;
  z-index: 1;
}

footer a {
  color: var(--text-secondary);
  text-decoration: underline;
  transition: color 0.15s;
}

footer a:hover {
  color: #fff;
}

.internal-notice {
  position: fixed;
  bottom: 16px;
  right: 24px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 300;
  z-index: 1;
}

@media (max-width: 520px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  main {
    padding: 24px 20px;
  }
}
