/* WCAG 2.2 AA Compliant Styles for PlanSA Sign-in */

:root {
  --page-bg: #f5f5f5;
  --card-bg: #ffffff;
  --text-primary: #333333;
  --text-secondary: #666666;
  --button-bg: #c1272d;
  --button-hover: #9e1f24;
  --button-active: #7a181c;
  --button-text: #ffffff;
  --error: #c1272d;
  --border: #cccccc;
  --border-focus: #5b8a9d;
  --link: #0066cc;
  --link-hover: #004499;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--page-bg);
  color: var(--text-primary);
  padding: 1rem;
  line-height: 1.5;
}

.container {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding-top: 2rem;
}

/* Logo Header */
.logo-header {
  background-color: var(--card-bg);
  padding: 2rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: center;
}

.logo {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Main Card */
.card {
  background: var(--card-bg);
  padding: 2.5rem 2rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.title {
  margin: 0 0 0.75rem;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--border-focus);
  line-height: 1.2;
}

.subtitle {
  margin: 0 0 1.75rem;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.5;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: var(--text-primary);
}

.input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder {
  color: #999999;
  opacity: 1;
}

.input:hover {
  border-color: #999999;
}

.input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(91, 138, 157, 0.25);
}

.input[aria-invalid="true"] {
  border-color: var(--error);
}

.input[aria-invalid="true"]:focus {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.25);
}

/* Button Styles */
.button {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--button-text);
  background: var(--button-bg);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease, font-weight 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-height: 44px; /* WCAG touch target size */
}

/* Active state when valid email is entered */
.button--active {
  font-weight: 700;
  background: var(--button-active);
  box-shadow: 0 2px 8px rgba(122, 24, 28, 0.4);
}

.button:hover:not(:disabled) {
  background: var(--button-hover);
}

.button--active:hover:not(:disabled) {
  background: #5c1215;
  box-shadow: 0 3px 12px rgba(122, 24, 28, 0.5);
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.button:focus {
  outline: 3px solid rgba(91, 138, 157, 0.5);
  outline-offset: 2px;
}

/* Error Message */
.error {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  color: var(--error);
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 4px;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Support Footer */
.support-footer {
  margin-top: 2rem;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e5e5;
}

.support-text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.support-link {
  color: var(--link);
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.15s ease;
}

.support-link:hover {
  color: var(--link-hover);
}

.support-link:focus {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Noscript Notice */
.noscript-notice {
  margin-top: 1.5rem;
  padding: 1rem;
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  color: #856404;
  font-size: 0.95rem;
}

.noscript-notice p {
  margin: 0;
}

/* Responsive Design */
@media (max-width: 480px) {
  body {
    padding: 0.5rem;
  }
  
  .container {
    padding-top: 1rem;
  }
  
  .logo-header {
    padding: 1.5rem 1rem;
  }
  
  .card {
    padding: 2rem 1.5rem;
  }
  
  .title {
    font-size: 1.5rem;
  }
  
  .subtitle {
    font-size: 0.95rem;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .input,
  .button,
  .card,
  .logo-header {
    border-width: 2px;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
