/* LetWorkBeDone - Register page | Brand green #00664e */

:root {
  --brand: #00664e;
  --brand-dark: #00523f;
  --text: #0f172a;
  --muted: #64748b;
  --bg: #f4f7f6;
  --card: #ffffff;
  --input-bg: #f1f5f9;
  --input-border: #9ca3af;
  --card-border: #e5e7eb;
  --error-bg: #fef2f2;
  --error-text: #b91c1c;
  --error-border: #fecaca;
  --success-bg: #ecfdf5;
  --success-text: #047857;
  --success-border: #a7f3d0;
}

*, *::before, *::after { box-sizing: border-box; }

body.register-page {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  -webkit-text-size-adjust: 100%;
}

.register-wrap { width: 100%; display: flex; justify-content: center; }

.register-card {
  width: 100%;
  max-width: 600px;
  background: var(--card);
  border-radius: 16px;
  padding: 22px 26px 18px;
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 30px -12px rgba(0, 102, 78, 0.18);
}

/* Header */
.register-header { text-align: center; margin-bottom: 14px; }

.brand-logo {
  display: block;
  width: 52px;
  height: 52px;
  margin: 0 auto 8px;
  border-radius: 50%;
}

.register-header h1 {
  margin: 0 0 2px;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sub { margin: 0; color: var(--muted); font-size: 0.88rem; }

/* Messages */
.register-msg {
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.86rem;
  line-height: 1.4;
  margin-bottom: 12px;
  border: 1px solid transparent;
}
.register-msg.error   { background: var(--error-bg);   color: var(--error-text);   border-color: var(--error-border); }
.register-msg.success { background: var(--success-bg); color: var(--success-text); border-color: var(--success-border); }

/* Form: one column on phones, two columns on laptops */
.register-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.field label,
.register-check {
  font-size: 0.84rem;
  font-weight: 600;
  color: #334155;
}

.field input,
.pass-wrap input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font-size: 16px; /* 16px prevents iOS zoom on focus */
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  outline: none;
}

.field input::placeholder,
.pass-wrap input::placeholder { color: #94a3b8; }

.field input:focus,
.pass-wrap input:focus { background: #fff; box-shadow: none; }

/* Password eye button */
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 42px; }

.eye-btn {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.eye-btn:hover, .eye-btn.active { color: var(--brand); background: #f1f5f9; }
.eye-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Terms checkbox */
.register-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.4;
  cursor: pointer;
}

.register-check input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.register-check a { color: var(--brand); font-weight: 600; text-decoration: none; }
.register-check a:hover { text-decoration: underline; }

/* Submit button */
.register-btn {
  height: 44px;
  width: 100%;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.register-btn:hover { background: var(--brand-dark); }
.register-btn:active { transform: scale(0.99); }
.register-btn:focus-visible { outline: 3px solid rgba(0, 102, 78, 0.25); outline-offset: 2px; }

/* Footer */
.register-footer { margin: 12px 0 0; text-align: center; font-size: 0.88rem; color: var(--muted); }
.register-footer a { color: var(--brand); font-weight: 600; text-decoration: none; }
.register-footer a:hover { text-decoration: underline; }

/* Laptop and desktop: two columns, so the whole form fits on screen */
@media (min-width: 640px) {
  .register-form { grid-template-columns: 1fr 1fr; gap: 10px 14px; }

  .register-form > .field:nth-child(3),   /* Email: full width */
  .register-form > .register-check,       /* Terms: full width */
  .register-form > .register-btn {        /* Button: full width */
    grid-column: 1 / -1;
  }
}

/* Phones: compact so the form fits on most screens */
@media (max-width: 480px) {
  body.register-page { padding: 8px; align-items: flex-start; }
  .register-card { padding: 16px 16px 14px; border-radius: 14px; }
  .brand-logo { width: 44px; height: 44px; margin-bottom: 6px; }
  .register-header { margin-bottom: 10px; }
  .register-header h1 { font-size: 1.15rem; }
  .sub { display: none; }
  .register-form { gap: 8px; }
  .field label { font-size: 0.82rem; }
  .field input, .pass-wrap input { height: 40px; }
  .register-footer { margin-top: 10px; }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --text: #f1f5f9;
    --muted: #94a3b8;
    --bg: #0b1412;
    --card: #111b18;
    --input-bg: #0f1a17;
    --input-border: #4b5563;
    --card-border: #1e293b;
  }
  .field label, .register-check { color: #cbd5e1; }
  .field input:focus, .pass-wrap input:focus { background: #0f1a17; }
  .eye-btn:hover, .eye-btn.active { background: #1e293b; }
  .register-msg.error   { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }
  .register-msg.success { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.3); color: #6ee7b7; }
}