/**
 * Member Authentication Styles
 * Rep Portal login, registration, and password reset forms
 */

.rep-portal {
  background-color: #f5f5f5;
  padding: 4rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rep-portal__container {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
}

/* Messages */
.rep-portal__message {
  padding: 1rem 1.5rem;
  border-radius: 0.25rem;
  margin-bottom: 2rem;
  font-size: 0.9375rem;
}

.rep-portal__message--error {
  background-color: #fef2f2;
  border-left: 4px solid #dc2626;
  color: #991b1b;
}

.rep-portal__message--success {
  background-color: #f0fdf4;
  border-left: 4px solid #16a34a;
  color: #166534;
}

/* Form Container */
.rep-portal__form-container {
  background: white;
  border-radius: 0.5rem;
  padding: 3rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  margin: 0 auto;
}

.rep-portal__form-container h1 {
  margin: 0 0 0.5rem;
  color: var(--wp--preset--color--primary, #1f4b75);
  font-size: 2rem;
  text-align: center;
}

.rep-portal__subtitle {
  text-align: center;
  color: #666;
  margin: 0 0 2rem;
  font-size: 1rem;
}

/* Form Elements */
.rep-portal__form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rep-portal__form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .rep-portal__form-row {
    grid-template-columns: 1fr;
  }
}

.rep-portal__form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rep-portal__form-group label {
  font-weight: 600;
  color: #1a1a1a;
  font-size: 0.9375rem;
}

.rep-portal__form-group label .required {
  color: #dc2626;
}

.rep-portal__form-group input[type="text"],
.rep-portal__form-group input[type="email"],
.rep-portal__form-group input[type="password"],
.rep-portal__form-group textarea {
  padding: 0.75rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 0.25rem;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
  background-color: white;
}

.rep-portal__form-group input:focus,
.rep-portal__form-group textarea:focus {
  outline: none;
  border-color: var(--wp--preset--color--primary, #1f4b75);
  box-shadow: 0 0 0 3px rgba(31, 75, 117, 0.1);
}

.rep-portal__form-group small {
  color: #666;
  font-size: 0.8125rem;
}

.rep-portal__form-group textarea {
  resize: vertical;
}

/* Checkbox */
.rep-portal__form-group--checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.rep-portal__form-group--checkbox label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 400;
  margin: 0;
}

.rep-portal__form-group--checkbox input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  cursor: pointer;
  accent-color: var(--wp--preset--color--primary, #1f4b75);
}

/* Turnstile Placeholder */
.rep-portal__turnstile {
  padding: 1rem;
  background-color: #f5f5f5;
  border-radius: 0.25rem;
  text-align: center;
}

.rep-portal__turnstile small {
  color: #999;
  font-size: 0.8125rem;
}

/* Buttons */
.rep-portal__button {
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.rep-portal__button--primary {
  background-color: var(--wp--preset--color--primary, #1f4b75);
  color: white;
}

.rep-portal__button--primary:hover {
  background-color: #173a5c;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(31, 75, 117, 0.3);
}

.rep-portal__button--primary:active {
  transform: translateY(0);
}

/* Form Footer */
.rep-portal__form-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: #666;
  font-size: 0.9375rem;
}

.rep-portal__form-footer a {
  color: var(--wp--preset--color--primary, #1f4b75);
  text-decoration: none;
  font-weight: 600;
}

.rep-portal__form-footer a:hover {
  text-decoration: underline;
}

.rep-portal__form-footer .separator {
  margin: 0 0.75rem;
  color: #ccc;
}

/* Portal Content (Logged In View) */
.rep-portal__header {
  background: white;
  border-radius: 0.5rem;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  position: relative;
}

.rep-portal__header h1 {
  margin: 0 0 0.5rem;
  color: var(--wp--preset--color--primary, #1f4b75);
  font-size: 2rem;
}

.rep-portal__rep-id {
  margin: 0;
  color: #666;
  font-size: 1rem;
}

.rep-portal__logout {
  position: absolute;
  top: 2rem;
  right: 2rem;
  color: #666;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
}

.rep-portal__logout:hover {
  color: var(--wp--preset--color--primary, #1f4b75);
}

.rep-portal__content {
  background: white;
  border-radius: 0.5rem;
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.rep-portal__content h2 {
  margin: 0 0 1rem;
  color: #1a1a1a;
  font-size: 1.5rem;
}

.rep-portal__sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.rep-portal__section {
  padding: 1.5rem;
  border: 2px solid #e0e0e0;
  border-radius: 0.25rem;
  transition: all 0.3s ease;
}

.rep-portal__section:hover {
  border-color: var(--wp--preset--color--primary, #1f4b75);
  box-shadow: 0 4px 12px rgba(31, 75, 117, 0.1);
}

.rep-portal__section h3 {
  margin: 0 0 0.5rem;
  color: var(--wp--preset--color--primary, #1f4b75);
  font-size: 1.25rem;
}

.rep-portal__section p {
  margin: 0;
  color: #666;
  font-size: 0.9375rem;
}

/* 2FA Form Specific Styles */
.rep-portal__form--2fa {
  text-align: center;
}

.rep-portal__2fa-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  color: var(--wp--preset--color--primary, #1f4b75);
}

.rep-portal__2fa-icon svg {
  width: 100%;
  height: 100%;
}

.rep-portal__2fa-input {
  font-size: 1.5rem !important;
  text-align: center;
  letter-spacing: 0.5rem;
  font-weight: 600;
  font-family: "Courier New", monospace;
}

.rep-portal__2fa-input::placeholder {
  letter-spacing: 0.5rem;
  color: #ccc;
}

/* Security Alerts in Portal */
.rep-portal__security-notice {
  margin-bottom: 2rem;
}

.rep-portal__alert {
  padding: 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  border-left: 4px solid;
}

.rep-portal__alert strong {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
}

.rep-portal__alert p {
  margin: 0 0 1rem;
  color: inherit;
}

.rep-portal__alert p:last-child {
  margin-bottom: 0;
}

.rep-portal__alert--warning {
  background-color: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}

.rep-portal__alert--success {
  background-color: #f0fdf4;
  border-color: #16a34a;
  color: #166534;
}

.rep-portal__alert a {
  color: var(--wp--preset--color--primary, #1f4b75);
  font-weight: 600;
}

.rep-portal__alert a:hover {
  text-decoration: none;
}

.rep-portal__button--secondary {
  background-color: #f5f5f5;
  color: var(--wp--preset--color--primary, #1f4b75);
  border: 2px solid var(--wp--preset--color--primary, #1f4b75);
  margin-top: 0.5rem;
}

.rep-portal__button--secondary:hover {
  background-color: var(--wp--preset--color--primary, #1f4b75);
  color: white;
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .rep-portal {
    padding: 2rem 1rem;
  }

  .rep-portal__form-container {
    padding: 2rem 1.5rem;
  }

  .rep-portal__form-container h1 {
    font-size: 1.5rem;
  }

  .rep-portal__header {
    padding: 1.5rem;
  }

  .rep-portal__logout {
    position: static;
    display: block;
    margin-top: 1rem;
    text-align: center;
  }

  .rep-portal__content {
    padding: 1.5rem;
  }

  .rep-portal__2fa-input {
    font-size: 1.25rem !important;
    letter-spacing: 0.25rem;
  }

  .rep-portal__2fa-input::placeholder {
    letter-spacing: 0.25rem;
  }
}
