/**
 * Auth Styles - Authentication Pages
 *
 * Login, Signup, Password Reset etc.
 * Split-screen SaaS layout pattern
 *
 * Reuses: swp-btn, swp-plan-card, swp-plan-badge (components.css)
 */

/* ===========================================
   AUTH LAYOUT - Split Screen
   =========================================== */
swp-auth-layout {
  display: grid;
  grid-template-columns: 45fr 55fr;
  min-height: 100vh;

  @media (max-width: 1024px) {
    grid-template-columns: 40fr 60fr;
  }

  @media (max-width: 768px) {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
}

/* ===========================================
   BRANDING PANEL (Left Side)
   =========================================== */
swp-auth-branding {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--spacing-24);
  background: linear-gradient(135deg, var(--color-teal) 0%, #00695c 100%);
  color: white;
  position: relative;
  overflow: hidden;

  /* Decorative background pattern */
  &::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
  }

  &::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
  }

  @media (max-width: 1024px) {
    padding: var(--spacing-16);
  }

  @media (max-width: 768px) {
    padding: var(--spacing-10) var(--spacing-6);
    text-align: center;
    align-items: center;
  }

  @media (max-width: 480px) {
    padding: var(--spacing-8) var(--spacing-5);
  }
}

swp-auth-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  margin-bottom: var(--spacing-16);
  position: relative;
  z-index: 1;

  & i {
    font-size: 32px;
  }

  & span {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.5px;
  }

  @media (max-width: 768px) {
    margin-bottom: var(--spacing-6);
    justify-content: center;
  }
}

swp-auth-tagline {
  display: block;
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  margin-bottom: var(--spacing-12);
  position: relative;
  z-index: 1;
  max-width: 400px;

  @media (max-width: 1024px) {
    font-size: var(--font-size-2xl);
  }

  @media (max-width: 768px) {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-4);
  }
}

swp-auth-subtitle {
  display: block;
  font-size: var(--font-size-lg);
  opacity: 0.9;
  margin-bottom: var(--spacing-16);
  position: relative;
  z-index: 1;
  max-width: 380px;
  line-height: var(--line-height-relaxed);

  @media (max-width: 768px) {
    display: none;
  }
}

/* ===========================================
   PLAN PANEL (Left Side - Alternative)
   =========================================== */
swp-auth-plan-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--spacing-24);
  background: var(--color-background);
  position: relative;

  swp-auth-logo {
    color: var(--color-text);
    margin-bottom: var(--spacing-12);

    & i {
      color: var(--color-teal);
    }

    @media (max-width: 768px) {
      display: none;
    }
  }

  @media (max-width: 1024px) {
    padding: var(--spacing-16);
  }

  @media (max-width: 768px) {
    padding: var(--spacing-6);
  }

  @media (max-width: 480px) {
    padding: var(--spacing-5);
  }
}

swp-selected-plan-header {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-5);

  @media (max-width: 768px) {
    text-align: center;
  }
}

/* ===========================================
   PLAN CONTENT (Auth-specific layout)
   Plan card/badge base styles in components.css
   =========================================== */
swp-plan-badge {
  margin-bottom: var(--spacing-4);
}

swp-plan-name {
  display: block;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: var(--spacing-1);
}

swp-plan-users {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-5);
}

swp-plan-price {
  display: flex;
  align-items: baseline;
  gap: var(--spacing-1);
  margin-bottom: var(--spacing-6);
  min-height: 44px;
}

swp-plan-price-amount {
  font-size: 36px;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  line-height: 1;

  &.contact {
    font-size: var(--font-size-xl);
    color: var(--color-purple);
  }

  @media (max-width: 768px) {
    font-size: 28px;
  }
}

swp-plan-price-period {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
}

swp-plan-features {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
}

swp-plan-feature {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  font-size: var(--font-size-sm);
  color: var(--color-text);

  & i {
    font-size: 18px;
    color: var(--color-green);
    flex-shrink: 0;
  }
}

/* ===========================================
   CHANGE PLAN LINK
   =========================================== */
swp-change-plan-link {
  display: block;
  margin-top: var(--spacing-6);

  & a {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);

    &:hover {
      color: var(--color-teal);
    }
  }

  & i {
    font-size: 16px;
  }

  @media (max-width: 480px) {
    text-align: center;
  }
}

/* ===========================================
   FEATURE LIST
   =========================================== */
swp-auth-features {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-5);
  position: relative;
  z-index: 1;

  @media (max-width: 768px) {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-4);
  }

  @media (max-width: 480px) {
    display: none;
  }
}

swp-auth-feature {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  font-size: var(--font-size-base);

  & i {
    font-size: 20px;
    opacity: 0.9;
  }

  @media (max-width: 768px) {
    font-size: var(--font-size-sm);
  }
}

/* ===========================================
   FORM PANEL (Right Side)
   =========================================== */
swp-auth-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-24);
  background: var(--color-surface);

  @media (max-width: 768px) {
    padding: var(--spacing-10) var(--spacing-6);
  }

  @media (max-width: 480px) {
    padding: var(--spacing-8) var(--spacing-5);
  }
}

swp-auth-form-container {
  width: 100%;
  max-width: 420px;

  @media (max-width: 768px) {
    max-width: 100%;
  }
}

swp-auth-header {
  display: block;
  margin-bottom: var(--spacing-12);
  text-align: center;
}

swp-auth-title {
  display: block;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--spacing-2);
}

swp-auth-description {
  display: block;
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
}

/* ===========================================
   USER INFO CARD (Pre-verified user)
   Base pattern in components.css, auth-specific styling only
   =========================================== */
swp-user-info-card {
  margin-bottom: var(--spacing-6);
}

swp-user-avatar {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-teal-strong);
  color: var(--color-teal);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  border-radius: 50%;
  flex-shrink: 0;
}

swp-user-verified {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-green);
  flex-shrink: 0;

  & i {
    font-size: 22px;
  }
}

/* ===========================================
   FORM ELEMENTS
   Base patterns in components.css, auth-specific only
   =========================================== */
swp-auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-5);
}

swp-form-input {
  select option {
    padding: var(--spacing-2);
  }

  &.has-icon input {
    padding-right: 44px;
  }

  .input-icon {
    position: absolute;
    right: var(--spacing-3);
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    cursor: pointer;
    padding: var(--spacing-2);
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);

    &:hover {
      color: var(--color-text-secondary);
    }

    & i {
      font-size: 20px;
      display: block;
    }
  }
}

swp-form-label {
  .optional {
    font-weight: var(--font-weight-normal);
    color: var(--color-text-muted);
  }
}

/* ===========================================
   PASSWORD STRENGTH INDICATOR
   =========================================== */
swp-password-strength {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  margin-top: var(--spacing-2);
}

swp-strength-bar {
  flex: 1;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}

swp-strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width var(--transition-normal), background var(--transition-normal);

  &.weak {
    width: 25%;
    background: var(--color-red);
  }

  &.fair {
    width: 50%;
    background: var(--color-amber);
  }

  &.good {
    width: 75%;
    background: var(--color-blue);
  }

  &.strong {
    width: 100%;
    background: var(--color-green);
  }
}

swp-strength-text {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  min-width: 50px;

  &.weak { color: var(--color-red); }
  &.fair { color: var(--color-amber); }
  &.good { color: var(--color-blue); }
  &.strong { color: var(--color-green); }
}

/* ===========================================
   CHECKBOX
   =========================================== */
swp-form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-3);
  cursor: pointer;

  input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--color-teal);
    flex-shrink: 0;
    margin-top: 2px;
  }

  & span {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: var(--line-height-normal);
  }

  & a {
    color: var(--color-teal);
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }
  }
}

/* Button base styles in components.css */

/* ===========================================
   AUTH FOOTER
   =========================================== */
swp-auth-footer {
  display: block;
  margin-top: var(--spacing-10);
  text-align: center;
}

swp-auth-footer-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);

  & a {
    color: var(--color-teal);
    font-weight: var(--font-weight-medium);
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }
  }
}

/* ===========================================
   DIVIDER
   =========================================== */
swp-auth-divider {
  display: flex;
  align-items: center;
  gap: var(--spacing-4);
  margin: var(--spacing-6) 0;

  &::before,
  &::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
  }

  & span {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
  }
}

/* ===========================================
   SOCIAL LOGIN
   =========================================== */
swp-social-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
}

/* Social button styles in components.css */

/* ===========================================
   FORM MESSAGES
   =========================================== */
swp-form-error,
swp-form-success {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  padding: var(--spacing-3) var(--spacing-4);
  border: 1px solid;
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);

  & i {
    font-size: 18px;
  }
}

swp-form-error {
  background: var(--bg-red-medium);
  border-color: var(--border-red);
  color: var(--color-red);
}

swp-form-success {
  background: var(--bg-green-medium);
  border-color: var(--border-green);
  color: var(--color-green);
}

/* ===========================================
   PRICING PAGE
   =========================================== */
swp-pricing-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: var(--spacing-16) var(--spacing-6);
  background: var(--color-background);
}

swp-pricing-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: var(--spacing-16);

  swp-auth-logo {
    margin-bottom: var(--spacing-10);
    color: var(--color-text);

    & i {
      color: var(--color-teal);
    }
  }
}

swp-pricing-title {
  display: block;
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: var(--spacing-3);
}

swp-pricing-subtitle {
  display: block;
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
}

swp-pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-6);
  max-width: 1100px;
  width: 100%;
  align-items: stretch;

  swp-plan-card {
    padding: var(--spacing-8);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;

    &.popular {
      border-color: var(--color-teal);
      box-shadow: var(--shadow-focus-ring);
      transform: scale(1.02);

      @media (max-width: 1024px) {
        transform: none;
        order: -1;
      }
    }
  }

  swp-plan-features {
    flex: 1;
  }

  swp-plan-action {
    margin-top: auto;
    padding-top: var(--spacing-6);
  }

  @media (max-width: 1024px) {
    grid-template-columns: 1fr;
    max-width: 400px;
  }
}

/* Plan badge/button styles in components.css */

swp-pricing-footer {
  margin-top: var(--spacing-12);
  text-align: center;
}

swp-pricing-footer-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);

  & a {
    color: var(--color-teal);
    font-weight: var(--font-weight-medium);
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }
  }
}

/* ===========================================
   PAYMENT PAGE
   =========================================== */
swp-order-summary {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
  margin-top: var(--spacing-5);
  padding-top: var(--spacing-5);
  border-top: 1px solid var(--color-border);
}

swp-order-line {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-sm);
  color: var(--color-text);

  &.discount {
    color: var(--color-green);
  }

  &.total {
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
  }
}

swp-order-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--spacing-2) 0;
}

swp-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-4);
}

swp-payment-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
  padding: var(--spacing-3);
  background: var(--bg-green-subtle);
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  color: var(--color-green);

  & i {
    font-size: 16px;
  }
}

swp-payment-processing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-5);
  padding: var(--spacing-16) 0;
}

swp-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-teal);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

swp-processing-text {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
}

swp-payment-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-4);
  padding: var(--spacing-16) 0;
}

swp-success-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-green-strong);
  border-radius: 50%;
  color: var(--color-green);

  & i {
    font-size: 32px;
  }
}

swp-success-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

swp-success-text {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
}

/* ===========================================
   RESPONSIVE - Plan Card (shared)
   =========================================== */
@media (max-width: 768px) {
  swp-plan-card {
    padding: var(--spacing-5);
  }
}
