/**
 * GawangPinas Auth Portal - Base Layout & Accessibility Baseline
 * Mobile-First, WCAG 2.2 Level AA Compliant.
 */

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

html {
  overflow-x: hidden;
  width: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Accessible Skip to Content Link */
.skip-link {
  position: absolute;
  top: -120px;
  left: 16px;
  background-color: var(--color-primary);
  color: #ffffff;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-sm);
  z-index: 9999;
  text-decoration: none;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 16px;
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

/* WCAG 2.2 Focus Appearance (2.4.13 & 2.4.11) */
:focus-visible {
  outline: var(--focus-outline-width) solid var(--focus-outline-color);
  outline-offset: var(--focus-outline-offset);
}

::selection {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

/* Links */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
  word-break: break-word;
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

/* Screen Reader Only Utility */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Mobile-First Page Scaffold */
.auth-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  justify-content: center;
  align-items: center;
  padding: 20px 14px;
  width: 100%;
}

.auth-container {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.auth-container--wide {
  max-width: 580px;
}

/* Card Scaffold */
.auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  box-shadow: var(--shadow-card);
  width: 100%;
}

@media (min-width: 480px) {
  .auth-page {
    padding: 32px 16px;
  }
  .auth-card {
    padding: 32px;
  }
}

/* Brand Header */
.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--touch-target-min);
  text-decoration: none;
  color: var(--color-text);
  border-radius: var(--radius-sm);
}

.brand-link:hover {
  text-decoration: none;
}

.brand-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: block;
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

/* Theme Toggle Button - Meets WCAG 2.2 44x44px target size */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-target-min);
  height: var(--touch-target-min);
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
  padding: 0;
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: var(--color-border);
  color: var(--color-text);
}

/* Page Intro & Headings */
.auth-intro {
  margin-bottom: 22px;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: 6px;
  line-height: 1.25;
  overflow-wrap: break-word;
}

.auth-desc {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.45;
  overflow-wrap: break-word;
}

/* Footer Note */
.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.auth-footer a {
  color: var(--color-text-muted);
  padding: 4px;
  display: inline-block;
}

.auth-footer a:hover {
  color: var(--color-primary);
}

/* Compact brand spacing across GawangPinas websites. */
body .brand-link { gap:6px; }

/* Slightly smaller website brand lockup. */
body .brand-logo { width:32px; height:32px; }
body .brand-title { font-size:18px; }
