/* RSH Network Authentication Pages Stylesheet */
/* Shared styles for sign in and sign up pages */

.auth-shell {
  min-height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #f8fafc;
  color: #111;
}

@media (min-width: 968px) {
  .auth-shell {
    flex-direction: row;
  }
}

/* Compact mode: single centered card, no full-page backdrop */
/* Note: Only use auth-compact class when you want a minimal form without benefits */
.auth-shell.auth-compact {
  background: transparent;
  min-height: auto;
  max-width: 980px;
  margin: 2.5rem auto;
  padding: 0 1rem;
}

@media (min-width: 968px) {
  .auth-shell.auth-compact {
    margin: 3.5rem auto 2.5rem;
    padding: 0 1.25rem;
  }
}

.auth-shell.auth-compact .auth-pane-left {
  display: none !important;
}

.auth-shell.auth-compact .auth-pane-right {
  background: transparent;
  min-height: auto;
  padding: 0;
}

.auth-shell.auth-compact .auth-card {
  max-width: 720px;
  margin: 0 auto;
}

/* Left Panel - Benefits Section */
.auth-shell .auth-pane-left {
  flex: 1;
  display: flex !important; /* Force display */
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background: radial-gradient(circle at 20% 20%, #4f46e5 0%, #6d28d9 40%, #111827 100%);
  color: #fff;
  position: relative;
  overflow-y: auto; /* Allow scrolling if content is too tall */
  overflow-x: hidden;
  min-height: 400px; /* Increased for better visibility on mobile */
}

@media (min-width: 968px) {
  .auth-shell .auth-pane-left {
    padding: 4rem 3rem;
    min-height: 100vh;
    flex: 0 0 50%;
  }
}

@media (min-width: 1200px) {
  .auth-shell .auth-pane-left {
    padding: 5rem 4rem;
    max-width: 45%;
  }
}

.auth-shell .auth-pane-left::before,
.auth-shell .auth-pane-left::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-shell .auth-pane-left::before {
  background: radial-gradient(circle at 75% 65%, rgba(255,255,255,.18), transparent 60%),
              radial-gradient(circle at 15% 85%, rgba(255,255,255,.12), transparent 55%);
}

.auth-shell .auth-pane-left::after {
  background: linear-gradient(120deg, rgba(255,255,255,.15), transparent 40%, transparent 60%, rgba(255,255,255,.08));
  mix-blend-mode: overlay;
}

.auth-shell .benefits {
  width: 100%;
  max-width: 540px;
  position: relative;
  z-index: 1;
}

.auth-shell .benefits h1 {
  margin: 0 0 1rem;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

@media (min-width: 968px) {
  .auth-shell .benefits h1 {
    font-size: 2.5rem;
    margin-bottom: 1.25rem;
    line-height: 1.1;
  }
}

.auth-shell .benefits p.lead {
  margin: 0 0 2rem;
  font-size: 1.05rem;
  line-height: 1.6;
  opacity: .92;
}

@media (min-width: 968px) {
  .auth-shell .benefits p.lead {
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
  }
}

.auth-shell .benefit-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 968px) {
  .auth-shell .benefit-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

.auth-shell .benefit-card {
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.3);
  padding: 1.25rem 1.35rem;
  border-radius: 16px;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.auth-shell .benefit-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(255,255,255,.22), transparent 55%);
  opacity: 0;
  transition: .4s;
}

.auth-shell .benefit-card:hover::before {
  opacity: 1;
}

.auth-shell .benefit-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.4);
}

.auth-shell .benefit-card strong {
  font-size: .95rem;
  font-weight: 600;
  display: block;
  letter-spacing: .2px;
  line-height: 1.3;
}

.auth-shell .benefit-card span {
  font-size: .85rem;
  opacity: .88;
  line-height: 1.45;
}

/* Right Panel - Form Section */
.auth-shell .auth-pane-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background: #f8fafc;
  min-height: 50vh; /* At least half viewport on mobile */
}

@media (min-width: 968px) {
  .auth-shell .auth-pane-right {
    padding: 4rem 3rem;
    flex: 0 0 50%;
    min-height: 100vh;
  }
}

@media (min-width: 1200px) {
  .auth-shell .auth-pane-right {
    padding: 5rem 4rem;
    max-width: 55%;
  }
}

/* Auth Card */
.auth-shell .auth-card {
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  padding: 2.25rem 2rem;
  box-shadow: 0 10px 35px -8px rgba(31,41,55,.18), 0 4px 12px -2px rgba(0,0,0,.08);
  position: relative;
}

@media (min-width: 968px) {
  .auth-shell .auth-card {
    padding: 2.75rem 2.5rem;
    border-radius: 28px;
  }
}

.auth-shell .auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, #6366f1, #8b5cf6, #ec4899);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .4;
  pointer-events: none;
  z-index: -1;
}

.auth-shell .auth-card h2 {
  margin: 0 0 1.5rem;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #111827;
  text-align: center;
}

@media (min-width: 968px) {
  .auth-shell .auth-card h2 {
    font-size: 1.85rem;
  }
}

/* Form Fields */
.auth-shell .field-block {
  margin: 0 0 1.15rem;
}

.auth-shell .field-block label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #475569;
  margin: 0 0 0.5rem;
  text-transform: none;
}

.auth-shell .text-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.95rem;
  background: #ffffff;
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}

.auth-shell .text-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
  background: #ffffff;
}

.auth-shell .text-input::placeholder {
  color: #94a3b8;
}

/* Remember Me Checkbox */
.auth-shell .remember-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0 1.25rem;
  font-size: 0.85rem;
  color: #475569;
}

.auth-shell .remember-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Primary Button */
.auth-shell .primary-btn {
  width: 100%;
  padding: 0.95rem 1.25rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5 0%, #6d28d9 50%, #ec4899 100%);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.3px;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 8px 20px -4px rgba(79,70,229,.4), 0 2px 6px rgba(0,0,0,.08);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.auth-shell .primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -6px rgba(79,70,229,.5), 0 4px 10px rgba(0,0,0,.12);
}

.auth-shell .primary-btn:active {
  transform: translateY(0);
}

/* Auth Links */
.auth-shell .auth-links {
  margin-top: 1rem;
  text-align: center;
}

.auth-shell .auth-links a {
  font-size: 0.85rem;
  font-weight: 600;
  color: #4f46e5;
  text-decoration: none;
  transition: all 0.2s ease;
}

.auth-shell .auth-links a:hover {
  color: #6d28d9;
  text-decoration: underline;
}

/* OAuth Buttons */
.auth-shell .oauth-btn {
  position: relative;
  z-index: 1;
  padding: 0.7rem 1rem !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  transition: all 0.2s ease !important;
}

.auth-shell .oauth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -4px rgba(0,0,0,.2) !important;
}

.auth-shell .oauth-btn i {
  font-size: 1.1rem;
}

/* Divider */
.auth-shell .auth-divider {
  position: relative;
  text-align: center;
  margin: 1.25rem 0;
}

.auth-shell .auth-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e2e8f0;
  z-index: 0;
}

.auth-shell .auth-divider-text {
  position: relative;
  display: inline-block;
  font-size: 0.85rem;
  color: #64748b;
  background: #ffffff;
  padding: 0 1rem;
  z-index: 1;
}

/* Password Strength Indicator */
.auth-shell .pw-strength {
  margin-top: 0.5rem;
}

.auth-shell .pw-bar {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.auth-shell .pw-bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: #94a3b8;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.auth-shell .pw-bar-fill.weak {
  width: 33%;
  background: #ef4444;
}

.auth-shell .pw-bar-fill.medium {
  width: 66%;
  background: #f59e0b;
}

.auth-shell .pw-bar-fill.strong {
  width: 100%;
  background: #10b981;
}

.auth-shell .pw-feedback {
  font-size: 0.75rem;
  color: #64748b;
  min-height: 1rem;
}

/* Alert Messages */
.auth-shell .auth-alert {
  margin-bottom: 1.5rem;
}

.auth-shell .auth-alert .alert {
  border-radius: 10px;
  font-size: 0.85rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}

.auth-shell .auth-alert .alert:last-child {
  margin-bottom: 0;
}

/* Responsive adjustments for mobile ONLY (below 768px) */
@media (max-width: 767px) {
  /* Mobile: Stack vertically, form on top */
  .auth-shell {
    flex-direction: column !important;
  }
  
  .auth-shell .auth-pane-left,
  .auth-shell .auth-pane-right {
    min-height: auto;
    max-width: 100%;
  }
  
  .auth-shell .auth-pane-left {
    padding: 2.5rem 1.5rem;
    display: flex !important; /* Ensure it's always visible */
  }
  
  .auth-shell .auth-pane-right {
    padding: 2.5rem 1.5rem;
  }
  
  .auth-shell .benefit-grid {
    grid-template-columns: 1fr;
  }
  
  /* Make benefits section more compact on mobile but still visible */
  .auth-shell .benefits h1 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
  }
  
  .auth-shell .benefits p.lead {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }
  
  .auth-shell .benefit-card {
    padding: 1rem 1.15rem;
  }
  
  .auth-shell .benefit-card strong {
    font-size: 0.9rem;
  }
  
  .auth-shell .benefit-card span {
    font-size: 0.8rem;
  }
}

/* Fix simple_form wrapper styles */
.auth-shell .auth-card .form-group {
  margin-bottom: 0;
}

.auth-shell .auth-card .invalid-feedback {
  display: block;
  font-size: 0.8rem;
  color: #ef4444;
  margin-top: 0.35rem;
}

.auth-shell .auth-card .is-invalid {
  border-color: #ef4444;
}

.auth-shell .auth-card .is-invalid:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.15);
}
