/*
  Shared page styles (auth + legacy pages using style.css)
*/

:root {
  --bg: #060810;
  --panel: rgba(13, 16, 30, 0.82);
  --panel2: rgba(20, 25, 44, 0.64);
  --text: #eef2ff;
  --muted: #a3acc9;
  --border: rgba(148, 163, 255, 0.22);
  --accent: #b443ff;
  --accent2: #2de6ff;
  --danger: #fb7185;
  --success: #34d399;
  --warning: #f59e0b;
  --field-bg: rgba(6, 10, 20, 0.55);
  --ghost-bg: rgba(255, 255, 255, 0.05);
  --radius: 16px;
  --shadow: 0 16px 40px rgba(2, 4, 12, 0.55);
}

html[data-theme="light"] {
  --bg: #eef4ff;
  --panel: rgba(255, 255, 255, 0.9);
  --panel2: rgba(241, 247, 255, 0.9);
  --text: #0f172a;
  --muted: #4f5c75;
  --border: rgba(78, 104, 170, 0.24);
  --accent: #6d3bff;
  --accent2: #0891b2;
  --field-bg: rgba(255, 255, 255, 0.92);
  --ghost-bg: rgba(255, 255, 255, 0.74);
  --shadow: 0 16px 30px rgba(24, 44, 92, 0.14);
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", "Inter", "SF Pro Text", system-ui, -apple-system, sans-serif;
  color: var(--text);
}

.bg,
body.auth-body,
body.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(180, 67, 255, 0.30), transparent 43%),
    radial-gradient(circle at 88% 12%, rgba(45, 230, 255, 0.22), transparent 38%),
    linear-gradient(166deg, #05070f 0%, #091126 52%, #0d142d 100%);
}

html[data-theme="light"] .bg,
html[data-theme="light"] body.auth-body,
html[data-theme="light"] body.auth-page {
  background:
    radial-gradient(circle at 12% 8%, rgba(109, 59, 255, 0.22), transparent 45%),
    radial-gradient(circle at 88% 12%, rgba(8, 145, 178, 0.18), transparent 42%),
    linear-gradient(170deg, #f8fbff 0%, #eef4ff 52%, #e8f0ff 100%);
}

.bg {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* Generic container/card used by auth + member legacy templates */
.container,
.center-card,
.card,
.panel,
.modal-box,
.modal-card,
.info-box,
.badge-showcase,
.left,
.right {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(155deg, var(--panel), var(--panel2));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

html.tmc-performance .container,
html.tmc-performance .center-card,
html.tmc-performance .card,
html.tmc-performance .panel,
html.tmc-performance .modal-box,
html.tmc-performance .modal-card,
html.tmc-performance .info-box,
html.tmc-performance .badge-showcase,
html.tmc-performance .left,
html.tmc-performance .right {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.center-card {
  width: min(480px, 100%);
  padding: 28px 24px;
}

/* Login split layout */
.auth-layout,
.container.auth-layout,
body.auth-page .container {
  width: min(980px, 96vw);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 0;
  overflow: hidden;
  padding: 0;
}

body.auth-page .left,
body.auth-page .right {
  border-radius: 0;
  box-shadow: none;
  border: 0;
  background: transparent;
  padding: 34px;
}

body.auth-page .left {
  border-right: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
}

body.auth-page .left img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 14px;
}

body.auth-page .subtitle {
  color: var(--muted);
}

.title,
h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
}

.title {
  margin-bottom: 14px;
  text-align: center;
  font-size: clamp(22px, 2.3vw, 28px);
  letter-spacing: 0.01em;
}

.form .field,
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
}

.form label,
.field label,
.label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.input,
input,
select,
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--field-bg);
  color: var(--text);
  padding: 11px 13px;
  outline: 0;
  box-sizing: border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.input::placeholder,
input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 72%, transparent);
}

.input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(117, 198, 255, 0.85);
  box-shadow: 0 0 0 3px rgba(45, 230, 255, 0.18), 0 0 0 1px rgba(180, 67, 255, 0.33) inset;
}

.input-wrapper {
  position: relative;
}

.input-wrapper input {
  padding-right: 44px;
}

.eye-btn,
#togglePassword,
.eye-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  opacity: 0.72;
  user-select: none;
  font-size: 16px;
}

.eye-btn:hover,
#togglePassword:hover,
.eye-icon:hover {
  opacity: 1;
}

.btn,
button,
.btnx,
.action-btn {
  border-radius: 12px;
  border: 1px solid transparent;
  color: #f8fbff;
  font-weight: 700;
  padding: 11px 15px;
  cursor: pointer;
  background: linear-gradient(115deg, var(--accent), #8b5cff 52%, var(--accent2));
  background-size: 220% 220%;
  box-shadow: 0 12px 26px rgba(117, 62, 245, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background-position 0.32s ease;
}

.btn:hover,
button:hover,
.btnx:hover,
.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(56, 28, 124, 0.46);
  background-position: 100% 50%;
}

.btn:active,
button:active,
.btnx:active,
.action-btn:active {
  transform: translateY(0);
}

.btn-ghost,
.btn.ghost,
.btnx.ghost,
button.ghost,
.action-btn:not(.points) {
  color: var(--text);
  border-color: var(--border);
  background: var(--ghost-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.small-link,
a.small-link,
a[href] {
  color: #b9d9ff;
  text-decoration: none;
}

.small-link:hover,
a[href]:hover {
  color: #ddedff;
}

html[data-theme="light"] .small-link,
html[data-theme="light"] a[href] {
  color: #2257c7;
}

html[data-theme="light"] .small-link:hover,
html[data-theme="light"] a[href]:hover {
  color: #143b8f;
}

.error {
  color: #fecdd3;
  font-size: 13px;
}

.msg {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
  font-size: 13px;
}

.msg.err {
  border-color: rgba(251, 113, 133, 0.42);
  background: rgba(251, 113, 133, 0.12);
  color: #fecdd3;
}

.muted,
.small,
.subtle {
  color: var(--muted);
}

/* Shared dashboard-like blocks used in legacy pages */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(155deg, var(--panel), var(--panel2));
  box-shadow: var(--shadow);
}

.brand {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.top-actions,
.actions,
.toolbar,
.search-row,
.row2 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.grid,
.grid-3 {
  display: grid;
  gap: 14px;
}

.grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.subcard {
  padding: 16px;
}

.card-title {
  margin: 0 0 10px;
  font-weight: 700;
}

.table,
table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td,
th,
td {
  padding: 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
  text-align: left;
  font-size: 13px;
}

th {
  color: var(--muted);
  letter-spacing: 0.03em;
}

.table tr:hover td,
tr:hover td {
  background: linear-gradient(90deg, rgba(180, 67, 255, 0.12), rgba(45, 230, 255, 0.08));
}

.center {
  text-align: center;
}

.badge,
.tag,
.badge-tag,
.role-row .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(180, 67, 255, 0.14);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.section-title {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.divider {
  height: 1px;
  margin: 18px 0;
  background: color-mix(in srgb, var(--border) 84%, transparent);
}

.input-container {
  position: relative;
}

.warning-box {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(251, 113, 133, 0.4);
  background: rgba(251, 113, 133, 0.12);
  color: #fecdd3;
}

/* SweetAlert harmonization */
.swal2-popup {
  border-radius: 18px !important;
  border: 1px solid var(--border) !important;
  background: linear-gradient(155deg, var(--panel), var(--panel2)) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow) !important;
}

.swal2-title,
.swal2-html-container {
  color: var(--text) !important;
}

.swal2-confirm {
  background: linear-gradient(115deg, var(--accent), #8b5cff 52%, var(--accent2)) !important;
  border: 1px solid rgba(209, 221, 255, 0.3) !important;
  border-radius: 12px !important;
}

.swal2-cancel {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
}

/* Auth utility wrappers used by rewritten templates */
.auth-shell {
  width: min(560px, 94vw);
  margin: 36px auto;
}

.auth-card {
  padding: clamp(20px, 3vw, 30px);
}

.auth-logo {
  width: 96px;
  height: 96px;
  margin: 0 auto 12px;
  display: block;
  object-fit: contain;
}

.auth-header {
  text-align: center;
  margin-bottom: 16px;
}

.auth-subtitle {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.auth-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-actions > * {
  flex: 1;
  min-width: 160px;
}

.auth-note {
  margin-top: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.auth-link-row {
  margin-top: 14px;
  text-align: center;
}

.auth-link-row a {
  color: #b9d9ff;
}

html[data-theme="light"] .error,
html[data-theme="light"] .msg.err,
html[data-theme="light"] .warning-box {
  color: #8a1f3f;
}

html[data-theme="light"] .msg.err,
html[data-theme="light"] .warning-box {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.32);
}

/* Responsive */
@media (max-width: 920px) {
  .container,
  .center-card,
  .card,
  .panel,
  .modal-box,
  .modal-card,
  .info-box,
  .badge-showcase,
  .left,
  .right {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .auth-layout,
  .container.auth-layout,
  body.auth-page .container,
  .grid,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  body.auth-page .left {
    border-right: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
  }

  body.auth-page .left,
  body.auth-page .right {
    padding: 24px;
  }
}

@media (max-width: 580px) {
  .bg {
    padding: 10px;
  }

  .center-card,
  .auth-card,
  .card,
  .panel,
  .container {
    border-radius: 14px;
  }

  .actions,
  .toolbar,
  .search-row,
  .row2,
  .auth-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn,
  button:not(.eye-btn):not(#togglePassword),
  .btnx,
  .action-btn {
    width: 100%;
  }

  .table,
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
