/* ==============================================
   Partalogic — Shared Pages Stylesheet
   Auth, Account, Utility pages
   ============================================== */

/* --- Reset & Variables (same as landing.css) --- */
:root {
  --bg-deep: #0f1117;
  --bg-primary: #161822;
  --bg-secondary: #1c1f2e;
  --bg-surface: #232738;
  --bg-surface-hover: #2a2f42;
  --accent: #4a9eff;
  --accent-hover: #3b8de6;
  --accent-subtle: rgba(74, 158, 255, 0.12);
  --text-primary: #e8eaf0;
  --text-secondary: #9498a8;
  --text-muted: #636780;
  --border: #2a2e3f;
  --border-light: #333750;
  --radius: 8px;
  --radius-lg: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --transition: 150ms ease;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --success: #22c55e;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

/* --- Simple Top Navbar --- */
.page-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.page-navbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.page-navbar-logo span {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-navbar-back {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-navbar-back:hover {
  color: var(--text-primary);
}

/* --- Centered Card Layout --- */
.page-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.page-wrapper-with-nav {
  min-height: calc(100vh - 64px);
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}

.card-wide {
  max-width: 600px;
}

.card-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.card-logo span {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.card-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 28px;
}

/* --- Tab Toggle --- */
.tab-toggle {
  display: flex;
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 28px;
}

.tab-toggle button {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
}

.tab-toggle button.active {
  background: var(--accent);
  color: #fff;
}

.tab-toggle button:not(.active):hover {
  color: var(--text-primary);
}

/* --- Form Styles --- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  transition: border-color var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input[readonly] {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.form-hint {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.form-hint a {
  font-size: 13px;
  color: var(--text-muted);
}

.form-hint a:hover {
  color: var(--accent);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  width: 100%;
}

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

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  width: 100%;
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

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

/* --- Divider ("or" separator) --- */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Social Button --- */
.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-social:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-light);
}

/* --- Card Footer Links --- */
.card-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.card-footer a {
  color: var(--accent);
  font-weight: 500;
}

/* --- Success State --- */
.success-state {
  display: none;
  text-align: center;
  padding: 20px 0;
}

.success-state.visible {
  display: block;
}

.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  background: rgba(34, 197, 94, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-state h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.success-state p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* --- Profile & Account Styles --- */
.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin: 0 auto 24px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.danger-zone {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.danger-zone h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--danger);
  margin-bottom: 8px;
}

.danger-zone p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* --- Subscription Styles --- */
.sub-current {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 32px;
}

.sub-current-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sub-plan-name {
  font-size: 20px;
  font-weight: 700;
}

.sub-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.sub-badge-active {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.sub-info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
}

.sub-info-label {
  color: var(--text-secondary);
}

.sub-info-value {
  font-weight: 600;
}

/* --- Usage Bar --- */
.usage-section {
  margin-bottom: 32px;
}

.usage-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.usage-item {
  margin-bottom: 12px;
}

.usage-header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 8px;
}

.usage-label {
  color: var(--text-secondary);
}

.usage-value {
  font-weight: 600;
}

.usage-bar {
  height: 8px;
  background: var(--bg-surface);
  border-radius: 4px;
  overflow: hidden;
}

.usage-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* --- Plan Comparison Cards --- */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.plan-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  transition: transform var(--transition);
}

.plan-card:hover {
  transform: translateY(-2px);
}

.plan-card.current {
  border-color: var(--accent);
}

.plan-card-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.plan-card h4 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.plan-price {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
}

.plan-price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
}

.plan-features {
  list-style: none;
  margin: 20px 0;
}

.plan-features li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 0;
  padding-left: 24px;
  position: relative;
}

.plan-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Ccircle cx='8' cy='8' r='8' fill='%234a9eff' opacity='.15'/%3E%3Cpath d='M5 8l2 2 4-4' stroke='%234a9eff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
}

.plan-card .btn {
  margin-top: auto;
}

/* --- Billing Section --- */
.billing-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.billing-section p {
  font-size: 14px;
  color: var(--text-secondary);
}

.billing-section .btn {
  width: auto;
}

/* --- Page Footer --- */
.page-footer {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

/* --- 404 Page --- */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 24px;
}

.error-code {
  font-size: 120px;
  font-weight: 800;
  color: var(--bg-surface-hover);
  line-height: 1;
  margin-bottom: 8px;
}

.error-text {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.error-page .btn {
  width: auto;
}

/* --- Hidden utility --- */
.hidden {
  display: none !important;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .card {
    padding: 28px 20px;
  }

  .card-wide {
    max-width: 100%;
  }

  .plan-grid {
    grid-template-columns: 1fr;
  }

  .billing-section {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .billing-section .btn {
    width: 100%;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .sub-current-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .error-code {
    font-size: 80px;
  }
}

@media (max-width: 480px) {
  .page-navbar {
    padding: 0 16px;
  }

  .card {
    padding: 24px 16px;
  }

  .tab-toggle button {
    font-size: 13px;
    padding: 8px;
  }
}
