/* WeCoop login — tokens, reset, layout */

:root {
  --brand: #FF4D1B;
  --brand-hover: #E5431A;
  --accent: #FFB72A;
  --accent-hover: #F2A50C;
  --accent-active: #D89000;
  --ink: #0A0A0A;
  --muted: #6B7280;
  --surface: #FFFFFF;
  --hairline: #E5E7EB;
  --hairline-strong: #D1D5DB;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-focus: 0 0 0 4px rgba(255, 77, 27, 0.18);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

button { font: inherit; color: inherit; }

/* Layout — 50/50 split, stacks on mobile */
.login {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.login__form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 6vw, 64px);
  position: relative;
  background: radial-gradient(circle at top left, rgba(255, 77, 27, 0.05), transparent 60%) var(--surface);
}

.login__form-inner {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.login__brand {
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  /* Subtle dot pattern */
  background-image:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.06) 1.5px, transparent 1.5px),
    linear-gradient(var(--brand), var(--brand));
  background-size: 24px 24px, 100% 100%;
  background-position: 0 0, 0 0;
}

.login__brand-mark {
  width: min(60%, 320px);
}

@media (max-width: 899px) {
  .login {
    grid-template-columns: 1fr;
  }
  .login__brand {
    display: none;
  }
}

/* Header */
.login__wordmark {
  width: 140px;
  margin-bottom: 32px;
}

.login__title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px 0;
  color: var(--ink);
}

.login__subtitle {
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 28px 0;
}

/* Form fields with floating label */
.login__form-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  position: relative;
}

.field__input {
  width: 100%;
  height: 56px;
  padding: 22px 14px 8px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field__input::placeholder { color: transparent; }

.field__input:hover { border-color: var(--hairline-strong); }

.field__input:focus {
  border-color: var(--brand);
  box-shadow: var(--shadow-focus);
}

.field__label {
  position: absolute;
  left: 14px;
  top: 18px;
  font-size: 16px;
  color: var(--muted);
  pointer-events: none;
  transition: transform 120ms ease, font-size 120ms ease, color 120ms ease;
  transform-origin: left top;
  background: transparent;
  padding: 0 4px;
}

.field__input:focus ~ .field__label,
.field__input:not(:placeholder-shown) ~ .field__label {
  transform: translateY(-12px);
  font-size: 12px;
  color: var(--brand);
}

/* Password field with eye toggle */
.field--password .field__input { padding-right: 48px; }

.field__toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.field__toggle:hover { color: var(--ink); background: rgba(0, 0, 0, 0.04); }

.field__toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.field__toggle svg { width: 20px; height: 20px; }

.field__toggle .icon-eye-off { display: none; }
.field__toggle[aria-pressed="true"] .icon-eye { display: none; }
.field__toggle[aria-pressed="true"] .icon-eye-off { display: block; }

/* Error region */
.login__error {
  display: none;
  margin-top: 12px;
  padding: 10px 14px;
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  border-radius: var(--radius-md);
  color: #991B1B;
  font-size: 14px;
}

.login__error.is-visible { display: block; }

/* Submit button: a styled <input type="image"> with text overlay */
.login__submit {
  position: relative;
  margin-top: 24px;
  height: 56px;
}

.login__submit-button {
  width: 100%;
  height: 100%;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 120ms ease, box-shadow 120ms ease;
}

.login__submit-button:hover { background: var(--accent-hover); }

.login__submit-button:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus), 0 0 0 2px var(--brand);
}

.login__submit-button:active { background: var(--accent-active); }

.login__submit-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.04em;
  pointer-events: none;
  user-select: none;
}
