/* ========================================
   Modern Register Page Styles
   ======================================== */

/* CSS Variables for consistent theming */
/*Perplexity: Claude Sonnet 4.5*/
:root {
  --header-bg: #354a5f;
  --btn-primary: #2563eb;
  --btn-hover: #1d4ed8;
  --btn-active: #1e40af;
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  --border-color: #d1d5db;
  --input-focus: rgba(37, 99, 235, 0.2);
  --error-bg: #fef2f2;
  --error-border: #fca5a5;
  --error-text: #dc2626;
  --shadow-sm: 0 1px 2px 0 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);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
}

/* Header Styles */
h1 {
  background: var(--header-bg);
  color: #ffffff;
  padding: 24px 32px;
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
  box-shadow: var(--shadow-md);
  text-align: center;
  width: 100%;
}

/* Instruction Paragraph */
body > p {
  color: #ffffff;
  font-size: 16px;
  margin: 32px 20px 0;
  text-align: center;
  max-width: 420px;
  font-weight: 400;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Error Message Styling */
body > p[style*="color: red"],
body > p[style*="color:red"] {
  background: var(--error-bg);
  color: var(--error-text) !important;
  border: 2px solid var(--error-border);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 24px auto 0;
  max-width: 420px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  text-shadow: none;
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* Main Container - Centers content */
body::before {
  content: '';
  flex: 1;
}

body::after {
  content: '';
  flex: 1;
}

/* Form Container */
.container {
  width: 100%;
  max-width: 420px;
  margin: 24px auto 40px;
  padding: 0 20px;
}

form {
  background: #ffffff;
  padding: 48px 40px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg), 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Form Labels */
label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  letter-spacing: 0.3px;
}

/* Input Fields */
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 24px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s ease;
  background: #ffffff;
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--btn-primary);
  box-shadow: 0 0 0 4px var(--input-focus);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: #9ca3af;
}

/* Invalid Input State */
input:invalid:not(:placeholder-shown) {
  border-color: var(--error-border);
}

/* Button Styles */
button[type="submit"] {
  width: 100%;
  padding: 14px 24px;
  background: var(--btn-primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.3px;
}

button[type="submit"]:hover {
  background: var(--btn-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

button[type="submit"]:active {
  background: var(--btn-active);
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

button[type="submit"]:focus-visible {
  outline: 3px solid var(--input-focus);
  outline-offset: 2px;
}

/* Loading State */
button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Responsive Design */
@media (max-width: 480px) {
  h1 {
    font-size: 20px;
    padding: 20px 16px;
  }

  body > p {
    font-size: 14px;
    margin-top: 24px;
  }

  form {
    padding: 32px 24px;
  }

  .container {
    padding: 0 16px;
    margin: 20px auto 32px;
  }

  body > p[style*="color: red"],
  body > p[style*="color:red"] {
    margin: 20px 16px 0;
    font-size: 13px;
    padding: 10px 14px;
  }
}

/* Tablet and up - slightly larger spacing */
@media (min-width: 768px) {
  .container {
    margin: 32px auto 48px;
  }

  body > p {
    margin-top: 40px;
    font-size: 17px;
  }
}

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

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  input[type="text"],
  input[type="password"] {
    border-width: 3px;
  }

  button[type="submit"] {
    border: 2px solid #000000;
  }
}
