/* =============================================================================
   POLY.PM AUTH PAGE - СТИЛИ ГЛАВНОЙ СТРАНИЦЫ
   ============================================================================= */

/* --- Reset --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1e293b;
  color: #e2e8f0;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Main Container --- */
.auth-container {
  width: 100%;
  max-width: 450px;
  padding: 20px;
}

/* --- Auth Card --- */
.auth-card {
  background: #334155;
  border-radius: 16px;
  padding: 48px 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* --- Logo --- */
.logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo h1 {
  font-size: 36px;
  font-weight: 700;
  color: #3b82f6;
  letter-spacing: -0.5px;
}

/* --- Title --- */
.auth-title {
  font-size: 24px;
  font-weight: 600;
  color: #f1f5f9;
  text-align: center;
  margin-bottom: 24px;
}

/* --- Instructions --- */
.instructions {
  background: #475569;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 32px;
}

.instructions p {
  font-size: 15px;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.instructions p:last-child {
  margin-bottom: 0;
}

.instructions a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.instructions a:hover {
  color: #60a5fa;
}

/* --- Code Input Container --- */
.code-input-container {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

/* --- Code Digit Input --- */
.code-digit {
  width: 56px;
  height: 64px;
  font-size: 28px;
  font-weight: 600;
  text-align: center;
  background: #475569;
  border: 2px solid #64748b;
  border-radius: 12px;
  color: #f1f5f9;
  outline: none;
  transition: all 0.2s;
  caret-color: #3b82f6;
}

.code-digit:focus {
  border-color: #3b82f6;
  background: #1e293b;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.code-digit.error {
  border-color: #ef4444;
  animation: shake 0.4s;
}

/* --- Error Message --- */
.error-message {
  min-height: 24px;
  margin-bottom: 16px;
  text-align: center;
  font-size: 14px;
  color: #ef4444;
  font-weight: 500;
}

/* --- Submit Button --- */
.submit-btn {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  background: #3b82f6;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 20px;
}

.submit-btn:hover:not(:disabled) {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.submit-btn:disabled {
  background: #64748b;
  cursor: not-allowed;
  opacity: 0.5;
}

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

.submit-btn.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

/* --- Help Link --- */
.help-link {
  text-align: center;
}

.help-link a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.help-link a:hover {
  color: #3b82f6;
}

/* --- Animations --- */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-4px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(4px);
  }
}

/* --- Mobile Responsive --- */
@media (max-width: 480px) {
  .auth-card {
    padding: 32px 24px;
  }

  .logo h1 {
    font-size: 32px;
  }

  .auth-title {
    font-size: 20px;
  }

  .code-digit {
    width: 48px;
    height: 56px;
    font-size: 24px;
  }

  .code-input-container {
    gap: 8px;
  }
}
