/* ============================================================
   REN Public Design System — pre-login pages only
   Fonts loaded via Google Fonts in public_base.html
   ============================================================ */

:root {
  /* Brand colours */
  --navy:         #1C2B3A;
  --navy-light:   #2D4156;
  --teal:         #1A7B6E;
  --teal-light:   #E8F5F3;
  --orange:       #E86830;
  --orange-light: #FEF3EC;
  --coral:        #E07B5B;
  --coral-light:  #FEF0ED;
  --blue:         #2E6B9A;
  --blue-light:   #EBF4FA;
  --purple:       #7C6FAA;

  /* Neutrals */
  --white:     #FFFFFF;
  --cream:     #FDF8F4;
  --gray-50:   #F9FAFB;
  --gray-100:  #F3F4F6;
  --gray-200:  #E5E7EB;
  --gray-300:  #D1D5DB;
  --gray-500:  #6B7280;
  --gray-600:  #4B5563;
  --gray-700:  #374151;
  --gray-900:  #111827;

  /* Typography */
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;

  /* Spacing scale */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);

  /* Radii */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--white);
  color: var(--gray-700);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--navy);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.125rem, 3vw, 1.375rem); }
h4 { font-size: 1rem; }

p {
  color: var(--gray-700);
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================================
   Layout
   ============================================================ */
.pub-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

section {
  padding: var(--space-16) 0;
}

/* ============================================================
   Accessibility utilities
   ============================================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Skip nav (accessibility)
   ============================================================ */
.skip-nav {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--navy);
  color: var(--white);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  z-index: 9999;
  transition: top 0.2s;
}
.skip-nav:focus { top: var(--space-4); }

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--orange);
  color: var(--white);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  text-decoration: none;
}
.btn-primary:hover {
  background: #d45e28;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: transparent;
  color: var(--navy);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  border: 2px solid var(--gray-300);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.15s;
  text-decoration: none;
}
.btn-outline:hover {
  border-color: var(--navy);
  color: var(--navy);
  transform: translateY(-1px);
}

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: none;
  border: none;
  color: var(--gray-700);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
  text-decoration: none;
}
.btn-text:hover {
  color: var(--navy);
  background: var(--gray-100);
}

/* ============================================================
   Tags / badges
   ============================================================ */
.pub-tag {
  display: inline-block;
  background: var(--orange-light);
  color: var(--orange);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

/* ============================================================
   Coming Soon page
   ============================================================ */
.coming-soon-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-5);
}

.coming-soon-inner {
  max-width: 520px;
}

.coming-soon-icon {
  width: 72px;
  height: 72px;
  background: var(--orange-light);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
  font-size: 2rem;
}

.coming-soon-inner h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: var(--space-4);
}

.coming-soon-inner p {
  font-size: 1.0625rem;
  color: var(--gray-600);
  margin-bottom: var(--space-8);
}

/* ============================================================
   Form elements (auth pages)
   ============================================================ */
.pub-form-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.pub-form-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-5);
  background: var(--cream);
}

.pub-form-card h1 {
  font-size: 1.75rem;
  margin-bottom: var(--space-2);
}

.pub-form-card .pub-form-subtitle {
  color: var(--gray-600);
  margin-bottom: var(--space-8);
  font-size: 0.9375rem;
}

.pub-field {
  margin-bottom: var(--space-5);
}

.pub-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--space-2);
}

.pub-field input,
.pub-field select,
.pub-field textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.pub-field input:focus,
.pub-field select:focus,
.pub-field textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(232, 104, 48, 0.12);
}

.pub-field input.auth-code-input {
  text-align: center;
  letter-spacing: 0.4em;
  font-size: 1.5rem;
  font-weight: 700;
}

.pub-form-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  color: #b91c1c;
  font-size: 0.875rem;
  margin-bottom: var(--space-5);
}

.pub-form-submit {
  width: 100%;
  padding: var(--space-4);
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.pub-form-submit:hover {
  background: #d45e28;
  transform: translateY(-1px);
}

.pub-form-alt {
  margin-top: var(--space-5);
  text-align: center;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.pub-form-alt a {
  color: var(--orange);
  font-weight: 600;
}
.pub-form-alt a:hover { text-decoration: underline; }

.pub-spam-hint {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  color: #92400e;
  font-size: 0.875rem;
  margin-bottom: var(--space-5);
}

.pub-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-5) 0;
  color: var(--gray-400);
  font-size: 0.8125rem;
}
.pub-divider::before,
.pub-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* Role selector on register page */
.pub-role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.pub-role-card {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
}
.pub-role-card:hover { border-color: var(--orange); background: var(--orange-light); }
.pub-role-card input[type="radio"] { display: none; }
.pub-role-card.selected { border-color: var(--orange); background: var(--orange-light); }
.pub-role-card .role-icon { font-size: 1.5rem; margin-bottom: var(--space-2); }
.pub-role-card .role-label { font-size: 0.875rem; font-weight: 600; color: var(--navy); }
