/* static/css/components/auth-flow.css */

/* Base styles (Mobile First) */
.auth-flow {
  min-height: 100vh;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
}

.auth-flow__header {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-primary);
  /* Header only shows on mobile, will be positioned over left side on desktop */
}

.auth-flow__logo {
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-size-xl);
  font-weight: 600;
  text-decoration: none;
}

.auth-flow__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 80px);
}

/* Form Side - Mobile */
.auth-flow__form-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 1;
  padding: var(--space-8) var(--space-4);
  min-width: 100%;
  position: relative;
}

.auth-form {
  display: flex;
  max-width: 360px;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
}

.auth-form__title {
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: clamp(1.5rem, 5vw, 30px);
  font-weight: 600;
  line-height: 1.27;
  margin: 0;
  text-align: center;
}

/* Form Fields */
.auth-form__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  width: 100%;
}

.auth-form__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
}

.auth-form__label {
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.43;
}

.auth-form__input {
  display: flex;
  padding: 10px 14px;
  align-items: center;
  border-radius: 8px;
  border: 1px solid #D5D7DA;
  background: var(--bg-primary);
  box-shadow: 0px 1px 2px 0px rgba(10, 13, 18, 0.05);
  
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  width: 100%;
  
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-form__input::placeholder {
  color: var(--text-primary);
  opacity: 0.7;
}

.auth-form__input:focus {
  outline: none;
  border-color: #EB1260;
  box-shadow: 0px 1px 2px 0px rgba(10, 13, 18, 0.05), 0 0 0 3px rgba(235, 18, 96, 0.1);
}

.auth-form__help-text {
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.43;
  margin: 0;
  margin-top: -var(--space-4);
}

/* Submit Button */
.auth-form__submit {
  display: flex;
  padding: 10px 16px;
  justify-content: center;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: #EB1260;
  box-shadow: 0px 0px 0px 1px rgba(10, 13, 18, 0.18) inset, 
              0px -2px 0px 0px rgba(10, 13, 18, 0.05) inset, 
              0px 1px 2px 0px rgba(10, 13, 18, 0.05);
  
  color: #FFF;
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  transition: all var(--transition-base);
  width: 100%;
}

.auth-form__submit:hover {
  background: #C10E52;
  transform: translateY(-1px);
}

/* Footer */
.auth-form__footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-1);
  text-align: center;
  flex-wrap: wrap;
}

.auth-form__footer-text {
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.43;
}

.auth-form__footer-link {
  color: #EB1260;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.43;
  text-decoration: none;
}

.auth-form__footer-link:hover {
  text-decoration: underline;
}

/* Image Side - Hidden on Mobile */
.auth-flow__image-side {
  display: none;
}

/* Error Styling */
.auth-form__error {
  color: var(--accent-danger);
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  margin-top: var(--space-1);
  display: block;
}

.auth-form__errors {
  margin-top: var(--space-3);
}

.auth-form__input.error {
  border-color: var(--accent-danger);
  box-shadow: 0px 1px 2px 0px rgba(10, 13, 18, 0.05), 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.auth-form__input.error:focus {
  border-color: var(--accent-danger);
  box-shadow: 0px 1px 2px 0px rgba(10, 13, 18, 0.05), 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Tablet and up */
@media (min-width: 768px) {
  .auth-flow {
      flex-direction: row;
      min-height: 100vh;
  }
  
  .auth-flow__header {
      position: absolute;
      top: 0;
      left: 0;
      width: 50%;
      z-index: 10;
      border-bottom: none;
      background: rgba(4, 8, 37, 0.9);
      backdrop-filter: blur(10px);
  }
  
  .auth-flow__main {
      flex-direction: row;
      min-height: 100vh;
  }
  
  .auth-flow__form-side {
      min-width: 480px;
      flex: 1 0 50%;
      padding-top: 120px; /* Account for header height */
  }
  
  .auth-flow__image-side {
      display: flex;
      flex: 1 0 50%;
      position: relative;
      height: 100vh;
  }
  
  .auth-image {
      position: relative;
      width: 100%;
      height: 100vh;
      overflow: hidden;
  }
  
  .auth-image__img {
      width: 100%;
      height: 100vh;
      object-fit: cover;
      object-position: center;
  }
  
  .auth-image__overlay {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      display: flex;
      width: 100%;
      padding: 96px 32px 32px 32px;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      background: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, rgba(0, 0, 0, 0.40) 100%);
  }
  
  .auth-image__title {
      color: #FFF;
      font-family: var(--font-family);
      font-size: 30px;
      font-weight: 600;
      line-height: 1.27;
      text-align: center;
      margin: 0;
  }
}

/* Login-specific styling additions */

/* Options row for Remember Me and Forgot Password */
.auth-form__options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: var(--space-4) 0;
  gap: var(--space-2);
}

/* Checkbox styling */
.auth-form__checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  user-select: none;
}

.auth-form__checkbox-input {
  width: 16px;
  height: 16px;
  border: 1px solid #D5D7DA;
  border-radius: 4px;
  background: var(--bg-primary);
  cursor: pointer;
  appearance: none;
  position: relative;
  flex-shrink: 0;
}

.auth-form__checkbox-input:checked {
  background: #EB1260;
  border-color: #EB1260;
}

.auth-form__checkbox-input:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 10px;
  font-weight: bold;
}

.auth-form__checkbox-text {
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.43;
  opacity: 0.8;
}

/* Forgot password link */
.auth-form__forgot-link {
  color: #EB1260;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.43;
  text-decoration: none;
  white-space: nowrap;
}

.auth-form__forgot-link:hover {
  text-decoration: underline;
  color: #EB1260;
}

/* Password Reset specific styling - Add to auth-flow.css */

/* Subtitle styling */
.auth-form__subtitle {
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
  text-align: center;
  opacity: 0.8;
  margin-bottom: var(--space-6);
}

/* Back link styling */
.auth-form__back-link {
  color: #EB1260;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.43;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  transition: all var(--transition-base);
}

.auth-form__back-link:hover {
  text-decoration: underline;
  color: #C10E52;
  transform: translateX(-2px);
}

.auth-form__back-link:focus {
  outline: 2px solid #EB1260;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Adjust footer for single link */
.auth-form__footer:has(.auth-form__back-link) {
  justify-content: center;
}

/* Responsive adjustments for subtitle */
@media (max-width: 480px) {
  .auth-form__subtitle {
      font-size: 14px;
      text-align: left;
  }
}

/* Success message styling (for when form is submitted) */
.auth-form__success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--accent-secondary);
  border-radius: 8px;
  padding: var(--space-4);
  margin-bottom: var(--space-6);
}

.auth-form__success-text {
  color: var(--accent-secondary);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.43;
  margin: 0;
  text-align: center;
}

/* Email Verification specific styling - Add to auth-flow.css */

/* Code input styling */
.auth-form__input--code {
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 8px;
  font-family: 'Courier New', monospace;
}

.auth-form__input--code::placeholder {
  letter-spacing: normal;
  font-size: 16px;
  font-weight: 400;
  font-family: var(--font-family);
}

/* Submit button loading state */
.auth-form__submit:disabled {
  background: rgba(235, 18, 96, 0.6);
  cursor: not-allowed;
  transform: none;
}

.auth-form__submit:disabled:hover {
  background: rgba(235, 18, 96, 0.6);
  transform: none;
}

.auth-form__submit-loading {
  display: none;
}

/* Timer styling */
.auth-form__timer {
  text-align: center;
  margin-top: var(--space-4);
}

.auth-form__timer-text {
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.43;
  opacity: 0.7;
}

/* Success state for resend link */
.auth-form__footer-link.success {
  color: var(--accent-secondary) !important;
}

/* Focus state for code input */
.auth-form__input--code:focus {
  border-color: #EB1260;
  box-shadow: 0px 1px 2px 0px rgba(10, 13, 18, 0.05), 0 0 0 3px rgba(235, 18, 96, 0.2);
}

/* Animation for auto-submit feedback */
.auth-form__input--code.auto-submitting {
  border-color: var(--accent-secondary);
  box-shadow: 0px 1px 2px 0px rgba(10, 13, 18, 0.05), 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Responsive adjustments for code input */
@media (max-width: 480px) {
  .auth-form__input--code {
      font-size: 20px;
      letter-spacing: 6px;
  }
}

/* Error state for code input */
.auth-form__input--code.error {
  text-align: center;
  border-color: var(--accent-danger);
}

/* Loading animation */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.auth-form__submit-loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Password Reset Specific Styles */
.auth-form__success-icon {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 2rem;
}

.auth-form__error-icon {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 2rem;
}

.auth-form__info-box {
  background: rgba(235, 18, 96, 0.1);
  border: 1px solid rgba(235, 18, 96, 0.2);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.auth-form__info-box h3 {
  color: #EB1260;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.auth-form__info-box ol {
  margin: 0;
  padding-left: 1.5rem;
}

.auth-form__info-box li {
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
}

.auth-form__password-help {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  font-size: 0.875rem;
}

.auth-form__password-help p {
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.auth-form__password-help ul {
  margin: 0;
  padding-left: 1.5rem;
}

.auth-form__password-help li {
  margin-bottom: 0.25rem;
  color: rgba(255, 255, 255, 0.8);
}

.auth-form__error-state {
  text-align: center;
}

.auth-form__error-reasons {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
  text-align: left;
}

.auth-form__error-reasons h3 {
  color: #ef4444;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.auth-form__error-reasons ul {
  margin: 0;
  padding-left: 1.5rem;
}

.auth-form__error-reasons li {
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
}

.auth-form__actions {
  margin: 2rem 0;
}

/* Responsive adjustments for options */
@media (max-width: 480px) {
  .auth-form__options {
      flex-direction: column;
      align-items: flex-start;
      gap: var(--space-3);
  }
  
  .auth-form__checkbox {
      align-self: flex-start;
  }
  
  .auth-form__forgot-link {
      align-self: flex-end;
  }
}

/* Focus states for accessibility */
.auth-form__checkbox-input:focus {
  outline: 2px solid #EB1260;
  outline-offset: 2px;
}

.auth-form__forgot-link:focus {
  outline: 2px solid #EB1260;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Large screens */
@media (min-width: 1024px) {
  .auth-flow__header {
      width: 720px; /* Match form side width */
  }
  
  .auth-flow__form-side {
      max-width: 720px;
  }
  
  .auth-image__title {
      font-size: clamp(1.5rem, 4vw, 30px);
  }
}

/* Container for header */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Header logo specific styling */
.header__logo {
  display: block;
  width: 141px;
  height: 53px;
}

.header__logo svg {
  width: 100%;
  height: 100%;
}