/* IPOB Reader Accounts & Moderation Styling */

:root {
  --ipob-acc-teal: #0D9488;
  --ipob-acc-teal-hover: #0F766E;
  --ipob-acc-navy: #1E3A8A;
  --ipob-acc-danger: #DC2626;
  --ipob-acc-surface: #FFFFFF;
  --ipob-acc-bg: #F8FAFC;
  --ipob-acc-border: #E2E8F0;
  --ipob-acc-text: #0F172A;
  --ipob-acc-muted: #64748B;
}

[data-theme="dark"] {
  --ipob-acc-surface: #1E293B;
  --ipob-acc-bg: #0F172A;
  --ipob-acc-border: #334155;
  --ipob-acc-text: #F8FAFC;
  --ipob-acc-muted: #94A3B8;
}

/* Auth Modal Backdrop & Card */
.ipob-auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.ipob-auth-modal.is-active {
  opacity: 1;
  visibility: visible;
}

.ipob-auth-dialog {
  background: var(--ipob-acc-surface);
  border: 1px solid var(--ipob-acc-border);
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  box-sizing: border-box;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  padding: 24px;
  position: relative;
}

@media (max-width: 480px) {
  .ipob-auth-dialog {
    padding: 20px 16px;
  }
}

.ipob-modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--ipob-acc-muted);
  cursor: pointer;
  padding: 6px;
  line-height: 1;
}

.ipob-modal-header {
  text-align: center;
  margin-bottom: 20px;
}

.ipob-modal-title {
  font-family: var(--font-headline, sans-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--ipob-acc-text);
  margin: 0 0 6px 0;
}

.ipob-modal-subtitle {
  font-size: 13px;
  color: var(--ipob-acc-muted);
  line-height: 1.5;
  margin: 0;
}

.ipob-auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ipob-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ipob-form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ipob-acc-text);
}

.ipob-form-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--ipob-acc-border);
  border-radius: 8px;
  background: var(--ipob-acc-bg);
  color: var(--ipob-acc-text);
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}

.ipob-form-input:focus {
  border-color: var(--ipob-acc-teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.ipob-btn-primary {
  background: var(--ipob-acc-teal);
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ipob-btn-primary:hover {
  background: var(--ipob-acc-teal-hover);
}

.ipob-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ipob-otp-input-row {
  display: flex;
  justify-content: center;
  margin: 10px 0;
  width: 100%;
}

.ipob-otp-large-input {
  font-family: monospace;
  font-size: 24px;
  letter-spacing: 6px;
  text-align: center;
  font-weight: 700;
  padding: 10px 8px;
  width: 100%;
  max-width: 220px;
  box-sizing: border-box;
  border: 2px solid var(--ipob-acc-teal);
  border-radius: 8px;
  background: var(--ipob-acc-bg);
  color: var(--ipob-acc-text);
}

@media (max-width: 480px) {
  .ipob-otp-large-input {
    font-size: 20px;
    letter-spacing: 4px;
    padding: 8px 4px;
    max-width: 190px;
  }
}

.ipob-consent-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--ipob-acc-muted);
  line-height: 1.4;
}

.ipob-notice {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
}

.ipob-notice-success {
  background: #DEF7EC;
  color: #03543F;
  border: 1px solid #BCF0DA;
}

.ipob-notice-error {
  background: #FDE8E8;
  color: #9B1C1C;
  border: 1px solid #FBD5D5;
}

/* Discussion Prompt & Comment Box */
.ipob-comment-gate {
  background: var(--ipob-acc-bg);
  border: 1px dashed var(--ipob-acc-teal);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  margin: 28px 0;
}

.ipob-comment-gate-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ipob-acc-text);
  margin-bottom: 6px;
}

.ipob-comment-gate-desc {
  font-size: 13px;
  color: var(--ipob-acc-muted);
  max-width: 480px;
  margin: 0 auto 16px;
  line-height: 1.5;
}

.ipob-comment-policy-banner {
  background: var(--ipob-acc-bg);
  border-left: 3px solid var(--ipob-acc-teal);
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: var(--ipob-acc-muted);
  margin-bottom: 16px;
}

.ipob-comment-author-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ipob-acc-text);
}

.ipob-report-btn {
  background: none;
  border: none;
  font-size: 11px;
  color: var(--ipob-acc-muted);
  cursor: pointer;
  text-decoration: underline;
  padding: 2px 4px;
}

.ipob-report-btn:hover {
  color: var(--ipob-acc-danger);
}

/* Profile Container */
.ipob-profile-container {
  max-width: 780px;
  margin: 32px auto;
  padding: 0 16px;
}

.profile-header-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--ipob-acc-surface);
  border: 1px solid var(--ipob-acc-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.profile-avatar-large {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ipob-acc-teal);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
}

.profile-info-main {
  flex: 1;
}

.profile-name {
  margin: 0 0 6px 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--ipob-acc-text);
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--ipob-acc-muted);
}

.profile-sections-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-card {
  background: var(--ipob-acc-surface);
  border: 1px solid var(--ipob-acc-border);
  border-radius: 10px;
  padding: 20px;
}

.profile-card.danger-zone {
  border-color: #FCA5A5;
  background: #FFF5F5;
}

[data-theme="dark"] .profile-card.danger-zone {
  background: #450A0A;
  border-color: #991B1B;
}

.profile-card-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px 0;
  color: var(--ipob-acc-text);
}

.profile-card-title.text-danger {
  color: var(--ipob-acc-danger);
}

.profile-card-desc {
  font-size: 13px;
  color: var(--ipob-acc-muted);
  line-height: 1.5;
  margin: 0 0 16px 0;
}

.input-with-button {
  display: flex;
  gap: 10px;
}

.input-with-button .form-control {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--ipob-acc-border);
  border-radius: 8px;
  background: var(--ipob-acc-bg);
  color: var(--ipob-acc-text);
}

/* Switch Toggle */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.toggle-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ipob-acc-text);
}

.toggle-desc {
  font-size: 12px;
  color: var(--ipob-acc-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #CBD5E1;
  transition: .3s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--ipob-acc-teal);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.btn-danger {
  background: var(--ipob-acc-danger);
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary {
  background: var(--ipob-acc-bg);
  color: var(--ipob-acc-text);
  border: 1px solid var(--ipob-acc-border);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-outline-danger {
  border: 1px solid var(--ipob-acc-danger);
  background: transparent;
  color: var(--ipob-acc-danger);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

/* Avatar Picker Grid */
.ipob-avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 10px 0;
}
@media (min-width: 640px) {
  .ipob-avatar-grid {
    grid-template-columns: repeat(10, 1fr);
  }
}
.ipob-avatar-option-btn {
  background: var(--ipob-acc-bg);
  border: 2px solid var(--ipob-acc-border);
  border-radius: 50%;
  padding: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  min-height: 54px;
  width: 54px;
  box-sizing: border-box;
}
.ipob-avatar-option-btn:hover {
  border-color: var(--ipob-acc-teal);
  transform: scale(1.08);
}
.ipob-avatar-option-btn.is-selected {
  border-color: var(--ipob-acc-teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.25);
  background: #CCFBF1;
}



/* Responsive 6-digit OTP boxes (ORDERS 07:00) */
.ipob-otp-boxes {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 280px;
  margin: 12px auto;
  box-sizing: border-box;
}

.ipob-otp-box {
  width: 38px;
  height: 46px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  border: 2px solid var(--ipob-acc-teal);
  border-radius: 8px;
  background: var(--ipob-acc-bg);
  color: var(--ipob-acc-text);
  box-sizing: border-box;
  outline: none;
  padding: 0;
}

.ipob-otp-box:focus {
  border-color: var(--ipob-acc-navy);
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
}

@media (max-width: 480px) {
  .ipob-auth-dialog {
    padding: 20px 14px !important;
    max-width: calc(100vw - 32px) !important;
  }
  .ipob-otp-boxes {
    gap: 4px;
    max-width: 260px;
  }
  .ipob-otp-box {
    width: 36px;
    height: 44px;
    font-size: 18px;
  }
}
