/* ==========================================================================
   OPUP Connection — Modern Account Portal Design System
   Consistent with OPUP AI (index.html) ChatGPT Minimal Aesthetics
   ========================================================================== */

:root {
  /* Dark Theme Variables (Default) */
  --bg-app: #17181f;
  --bg-sidebar: #13151b;
  --bg-surface: #1d1f2b;
  --bg-surface-raised: #232635;
  --bg-surface-hover: rgba(255, 255, 255, 0.06);
  --bg-input: #1e202c;
  --bg-glass: rgba(23, 24, 31, 0.94);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(255, 255, 255, 0.25);
  --border-glow: 0 0 0 2px rgba(255, 255, 255, 0.1);

  --text-primary: #f4f4f5;
  --text-secondary: #d4d4d8;
  --text-muted: #8e8ea0;
  --text-subtle: #71717a;

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-tertiary: #38bdf8;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #38bdf8 100%);

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.25);

  --font-main: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-app: #ffffff;
  --bg-sidebar: #f9f9fb;
  --bg-surface: #f9f9fb;
  --bg-surface-raised: #f4f4f5;
  --bg-surface-hover: rgba(0, 0, 0, 0.04);
  --bg-input: #f4f4f5;
  --bg-glass: rgba(255, 255, 255, 0.94);

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-medium: rgba(0, 0, 0, 0.12);
  --border-focus: rgba(0, 0, 0, 0.25);
  --border-glow: 0 0 0 2px rgba(0, 0, 0, 0.08);

  --text-primary: #0d0d0d;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --text-subtle: #9ca3af;

  --accent-primary: #4f46e5;
  --accent-secondary: #7c3aed;
  --accent-tertiary: #0284c7;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.08);
}

/* Base resets & typography */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100vh;
  width: 100%;
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  background: var(--bg-app);
}

/* Header Bar */
.account-header {
  height: 52px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-app);
  position: sticky;
  top: 0;
  z-index: 50;
  box-sizing: border-box;
  width: 100%;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.2px;
  transition: opacity var(--transition-fast);
}

.brand-link:hover {
  text-decoration: none;
}

.brand-icon-wrap {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #38bdf8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

[data-theme="light"] .brand-icon-wrap {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #38bdf8 100%);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-name {
  font-weight: 700;
  letter-spacing: -0.25px;
  font-size: 14.5px;
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-back-chat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: all var(--transition-fast);
}

[data-theme="light"] .btn-back-chat {
  background: rgba(0, 0, 0, 0.05);
}

.btn-back-chat:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
  text-decoration: none;
}

[data-theme="light"] .btn-back-chat:hover {
  background: rgba(0, 0, 0, 0.09);
}

.btn-theme-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.btn-theme-toggle:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* Page Center Layout */
.auth-page-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 48px;
  position: relative;
  z-index: 1;
}

/* Card Container (ChatGPT Clean Floating Card) */
.wrap {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: var(--shadow-md);
  box-sizing: border-box;
  animation: fadeIn 0.25s ease-out;
  position: relative;
}

/* Card Header Hero */
.auth-card-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
}

.hero-logo-wrap {
  position: relative;
  margin-bottom: 12px;
}

.hero-logo-aura {
  display: none;
}

.hero-logo-img {
  width: 130px;
  height: auto;
  position: relative;
  z-index: 1;
  display: block;
}

h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Segmented Tabs Switcher (ChatGPT Style) */
.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 20px;
  position: relative;
}

[data-theme="light"] .auth-tabs {
  background: rgba(0, 0, 0, 0.04);
}

.tab-btn {
  flex: 1;
  padding: 7px 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  border-radius: 7px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 0 !important;
  width: auto !important;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: #8B8FF7;
  color: #20213A;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(139, 143, 247, 0.35);
}

[data-theme="light"] .tab-btn.active {
  background: #8B8FF7;
  color: #20213A;
}

/* Form Styles */
.form-group {
  margin-bottom: 14px;
  text-align: left;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

input {
  width: 100%;
  height: 42px;
  box-sizing: border-box;
  padding: 0 14px 0 38px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-primary);
  font-family: var(--font-main);
  outline: none;
  transition: all var(--transition-fast);
}

[data-theme="light"] input {
  background: rgba(0, 0, 0, 0.03);
}

input:focus {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

[data-theme="light"] input:focus {
  border-color: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}

input::placeholder {
  color: var(--text-subtle);
}

/* Password Toggle Icon Button */
.btn-pwd-toggle {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto !important;
  margin-top: 0 !important;
  transition: color var(--transition-fast);
}

.btn-pwd-toggle:hover {
  color: var(--text-primary);
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Primary Submit Buttons (ChatGPT Bold Clean Button) */
button[type="submit"],
.btn-primary-auth {
  width: 100%;
  height: 42px;
  margin-top: 16px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: #8B8FF7;
  color: #20213A;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(139, 143, 247, 0.35);
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

[data-theme="light"] button[type="submit"],
[data-theme="light"] .btn-primary-auth {
  background: #8B8FF7;
  color: #20213A;
  box-shadow: 0 4px 14px rgba(139, 143, 247, 0.3);
}

button[type="submit"]:hover,
.btn-primary-auth:hover {
  background: #9aa0f9;
  box-shadow: 0 6px 20px rgba(139, 143, 247, 0.45);
  transform: translateY(-1px);
}

button[type="submit"]:active,
.btn-primary-auth:active {
  background: #7d81ea;
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(139, 143, 247, 0.3);
}

button[type="submit"]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button.secondary {
  width: 100%;
  height: 40px;
  margin-top: 10px;
  padding: 0 16px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

button.secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-medium);
}

button.danger {
  width: 100%;
  height: 40px;
  margin-top: 10px;
  padding: 0 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

button.danger:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}

button.danger-outline {
  width: 100%;
  height: 36px;
  margin-top: 10px;
  padding: 0 16px;
  background: transparent;
  border: 1px solid transparent;
  color: #f87171;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

button.danger-outline:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

/* Alert Messages */
.msg {
  margin-top: 14px;
  font-size: 12.5px;
  padding: 10px 14px;
  border-radius: 8px;
  display: none;
  line-height: 1.45;
  animation: fadeIn 0.2s ease-out;
}

.msg.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  display: block;
}

.msg.ok {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  display: block;
}

/* Toggle Form Links */
.toggle {
  margin-top: 18px;
  font-size: 12.5px;
  text-align: center;
  color: var(--text-muted);
}

.toggle a {
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-left: 4px;
  transition: opacity var(--transition-fast);
}

.toggle a:hover {
  opacity: 0.8;
}

.auth-terms {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-subtle);
  text-align: center;
  line-height: 1.4;
}

.auth-terms a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-terms a:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   LOGGED IN ACCOUNT VIEW
   ========================================================================== */
.account-profile-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  text-align: left;
}

[data-theme="light"] .account-profile-card {
  background: rgba(0, 0, 0, 0.02);
}

.account-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.account-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: none;
}

.account-user-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 1px;
}

.account-email-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

#accountEmail {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.status-label-wrap {
  font-size: 12px;
  color: var(--text-muted);
}

/* Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.status-active {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.status-active::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.status-canceling {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.status-canceling::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
}

.status-none,
.status-cancelled {
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

/* Membership Features Highlight */
.features-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin: 16px 0;
  text-align: left;
}

.features-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-tertiary);
  margin-bottom: 8px;
}

.features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.features-list li {
  font-size: 12.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.features-list li svg {
  color: #10b981;
  flex-shrink: 0;
}

/* Subscribe Area Container */
#subscribeArea {
  margin: 16px 0;
}

/* Notifications Area */
#notifArea {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}

.notif {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  animation: fadeIn 0.25s ease-out;
}

.notif a {
  color: var(--accent-tertiary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  font-size: 12px;
  padding: 2px 8px;
  background: var(--bg-surface);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.notif a:hover {
  color: #ffffff;
  border-color: var(--accent-primary);
}

.account-actions-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 20px 0 16px;
}

/* Page Footer */
.site-footer {
  padding: 24px 20px 32px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.footer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
}

.footer-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-nav a:hover {
  color: var(--accent-tertiary);
  text-decoration: underline;
}

.footer-copy {
  color: var(--text-subtle);
  font-size: 11.5px;
}

/* Keyframe Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes auraPulse {
  0% {
    transform: scale(0.92);
    opacity: 0.3;
  }

  100% {
    transform: scale(1.15);
    opacity: 0.55;
  }
}

/* Responsive Rules */
@media (max-width: 480px) {
  .account-header {
    padding: 0 14px;
    height: 54px;
  }

  .wrap {
    padding: 26px 20px 24px;
    border-radius: var(--radius-lg);
  }

  h1 {
    font-size: 20px;
  }

  .hero-logo-img {
    width: 110px;
  }

  .btn-back-chat span {
    display: none;
  }

  .btn-back-chat {
    padding: 7px 10px;
  }
}