/* ============================================================
   AUTH.CSS — Login overlay, subscription expired screen
   ============================================================ */

.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.85); /* Slightly darker for better contrast */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column; /* Better for scrolling content */
  align-items: center;
  overflow-y: auto; /* Enable scrolling */
  padding: 30px 20px; /* Reduced space at top and bottom */
  z-index: var(--z-auth);
  animation: fadeIn .5s ease-in;
}

.auth-container {
  background: white;
  border-radius: 20px;
  padding: 15px 25px; /* Extremely tight padding */
  max-width: 580px;
  width: 95%;
  margin: auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: slideUp .6s ease-out;
  position: relative;
}

.auth-header {
  text-align: center;
  margin-bottom: 10px; /* Even tighter */
}

.lock-icon {
  font-size: 56px;
  margin-bottom: 12px;
  display: block;
  animation: pulse 2s infinite;
}

.auth-header h1 {
  font-size: 24px;
  margin-bottom: 4px; /* Reduced */
  color: var(--blue);
  font-weight: 900;
  background: linear-gradient(135deg, #1e3c72, #7e22ce);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-header p {
  font-size: 13px;
  color: var(--muted);
}

.auth-form-group {
  margin-bottom: 8px; /* Even tighter */
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px; /* Even tighter gap */
  margin-bottom: 0px; 
}

@media (max-width: 500px) {
  .auth-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.auth-form-group label {
  display: block;
  margin-bottom: 4px; /* Ultra-tight label spacing */
  font-size: 12px; /* Slightly smaller labels */
  font-weight: 700;
  color: #475569;
}

.auth-form-group input {
  width: 100%;
  padding: 10px 14px; /* Reduced input padding */
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  transition: var(--transition);
  font-family: var(--font-body);
}

.auth-form-group input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, .12);
  outline: none;
}

.password-toggle-wrapper {
  position: relative;
  width: 100%;
}

.password-toggle-wrapper input {
  width: 100% !important;
  padding-right: 45px !important;
}

.password-toggle-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  user-select: none;
  font-size: 18px;
  color: #64748b;
  transition: color 0.2s;
  z-index: 5;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle-icon:hover {
  color: #3b82f6;
}

.auth-btn {
  width: 100%;
  padding: 12px; /* Reduced button padding */
  margin-top: 5px; /* Even tighter */
  background: linear-gradient(135deg, #2a5298, #7e22ce);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(126, 34, 206, .35);
}

.auth-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.auth-footer {
  margin-top: 15px;
  text-align: center;
  padding-top: 16px;
  border-top: 2px solid #e5e7eb;
  color: #64748b;
  font-size: 12px;
}

/* ── Error message ── */
.error-message {
  background: #fee2e2;
  color: #dc2626;
  padding: 11px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  display: none;
  border: 2px solid #fecaca;
}

.error-message.show {
  display: block;
  animation: shake .5s;
}

/* ── Session indicator ── */
.session-indicator {
  background: rgba(16, 185, 129, .92);
  color: white;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: var(--z-notif);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
  backdrop-filter: blur(8px);
}

.logout-btn {
  background: rgba(255, 255, 255, .2);
  border: none;
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 4px;
  transition: background .2s;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, .35);
}

.sub-pill {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 800;
  margin-left: 6px;
}

.sub-pill.ok {
  background: rgba(255, 255, 255, .25);
  color: white;
}

.sub-pill.warn {
  background: #f59e0b;
  color: white;
}

.sub-pill.bad {
  background: #ef4444;
  color: white;
}

/* ── Subscription expired overlay ── */
.sub-expired-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, .8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-auth);
}

.sub-expired-overlay.show {
  display: flex;
}

.sub-expired-box {
  background: white;
  border-radius: 16px;
  padding: 40px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.sub-expired-box h2 {
  font-size: 22px;
  font-weight: 900;
  color: #dc2626;
  margin-bottom: 12px;
}

.sub-expired-box p {
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
}