/* Samwise Auth — Brand-consistent styling */

@import url('https://fonts.googleapis.com/css2?family=Lora:wght@500;600&family=Inter:wght@400;500;600&display=swap');

:root {
  --forest-green: #2C5F2D;
  --forest-deep: #1E4620;
  --warm-amber: #F4B41A;
  --amber-hover: #D9A016;
  --cream-paper: #F8F5E6;
  --ink-black: #1A1A1A;
  --error-red: #C0392B;
  --success-green: #27AE60;
}

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

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--forest-green);
  color: var(--cream-paper);
  line-height: 1.6;
}

.page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 2rem 1rem;
}

/* Noise texture */
.page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
}

.container {
  text-align: center;
  z-index: 1;
  width: 100%;
  max-width: 400px;
}

/* Logo */
.brand {
  margin-bottom: 2.5rem;
}

.logo {
  width: 240px;
  height: auto;
  color: var(--cream-paper);
}

.logo .counter {
  fill: var(--forest-green);
}

/* Headings */
h1 {
  font-family: 'Lora', Georgia, serif;
  font-weight: 600;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 0.875rem;
  opacity: 0.8;
  margin-bottom: 2rem;
}

/* Device code display */
.device-code {
  font-family: 'Lora', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--warm-amber);
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  margin-bottom: 2rem;
  display: inline-block;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
  opacity: 0.9;
}

input[type="email"],
input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  background: var(--cream-paper);
  color: var(--ink-black);
  border: 2px solid transparent;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s;
}

input[type="email"]:focus,
input[type="text"]:focus {
  border-color: var(--warm-amber);
}

input[type="email"]::placeholder,
input[type="text"]::placeholder {
  color: #999;
}

/* Buttons */
.btn {
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  background: var(--warm-amber);
  color: var(--ink-black);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-top: 0.5rem;
}

.btn:hover {
  background: var(--amber-hover);
}

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

.btn-link {
  background: none;
  border: none;
  color: var(--cream-paper);
  opacity: 0.7;
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  cursor: pointer;
  margin-top: 1rem;
  padding: 0.25rem 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-link:hover {
  opacity: 1;
}

.btn-link:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Messages */
.message {
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-top: 1.25rem;
  display: none;
}

.message.visible {
  display: block;
}

.message.info {
  background: rgba(0, 0, 0, 0.15);
  color: var(--cream-paper);
}

.message.success {
  background: rgba(39, 174, 96, 0.2);
  color: #A8E6C0;
}

.message.error {
  background: rgba(192, 57, 43, 0.2);
  color: #F5B7B1;
}

.message.pending {
  background: rgba(244, 180, 26, 0.15);
  color: var(--warm-amber);
}

/* Steps */
.step {
  display: none;
}

.step.active {
  display: block;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(26, 26, 26, 0.3);
  border-top-color: var(--ink-black);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}

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

/* Accent bar */
.accent-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--warm-amber) 20%,
    var(--warm-amber) 80%,
    transparent 100%
  );
  opacity: 0.8;
  z-index: 10;
}

/* Responsive */
@media (max-width: 480px) {
  .logo {
    width: 180px;
  }

  .device-code {
    font-size: 1.5rem;
    letter-spacing: 0.1em;
  }

  h1 {
    font-size: 1.25rem;
  }
}
