/* ===== FrostWeb Identity — Account Shared Styles ===== */
/* Matches login.html: #0d1117, #c9a227, #58a6ff, Cinzel + Inter */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700&family=Inter:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  min-height: 100vh;
  background: #0d1117;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(88, 166, 255, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(201, 162, 39, 0.04) 0%, transparent 50%);
  color: #e6edf3;
  display: flex;
  justify-content: center;
}

/* ===== Centered Layout: sidebar + content as one centered block ===== */
.account-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 1060px;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 240px;
  background: rgba(22, 27, 34, 0.6);
  border-right: 1px solid rgba(88, 166, 255, 0.1);
  padding: 2rem 0;
  flex-shrink: 0;
}

.sidebar-logo {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: #c9a227;
  letter-spacing: 0.05em;
  text-decoration: none;
  display: block;
  padding: 0 1.5rem;
  margin-bottom: 0.25rem;
}

.sidebar-subtitle {
  font-size: 0.75rem;
  color: #484f58;
  padding: 0 1.5rem;
  margin-bottom: 2rem;
}

.sidebar-nav { display: flex; flex-direction: column; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: #8b949e;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  color: #e6edf3;
  background: rgba(88, 166, 255, 0.05);
}

.sidebar-link.active {
  color: #e6edf3;
  background: rgba(88, 166, 255, 0.08);
  border-left-color: #c9a227;
}

.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-divider {
  height: 1px;
  background: rgba(88, 166, 255, 0.08);
  margin: 1rem 1.5rem;
}

.sidebar-download {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  color: #c9a227;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
}
.sidebar-download:hover { color: #d4ad2e; background: rgba(201, 162, 39, 0.05); }

.sidebar-back {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  color: #484f58;
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s;
}
.sidebar-back:hover { color: #8b949e; }

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  color: #f85149;
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
  width: 100%;
  text-align: left;
}
.sidebar-logout:hover { color: #ff7b72; background: rgba(248, 81, 73, 0.05); }

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  padding: 3rem 3rem 3rem 2.5rem;
  min-width: 0;
}

.page-title {
  font-family: 'Cinzel', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #e6edf3;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  font-size: 0.85rem;
  color: #8b949e;
  margin-bottom: 2rem;
}

/* ===== Cards ===== */
.card {
  background: rgba(22, 27, 34, 0.85);
  border: 1px solid rgba(88, 166, 255, 0.15);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(20px);
  box-shadow: 0 0 40px rgba(88, 166, 255, 0.03), 0 8px 32px rgba(0, 0, 0, 0.2);
}

.card-title {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #e6edf3;
  margin-bottom: 0.25rem;
}

.card-description {
  font-size: 0.8rem;
  color: #8b949e;
  margin-bottom: 1.25rem;
}

.card-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(88, 166, 255, 0.15), transparent);
  margin: 1.25rem 0;
}

/* ===== Forms ===== */
.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: #8b949e;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(13, 17, 23, 0.8);
  border: 1px solid rgba(88, 166, 255, 0.15);
  border-radius: 8px;
  color: #e6edf3;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-group input:focus {
  border-color: rgba(201, 162, 39, 0.5);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.1);
}

.form-group input::placeholder { color: #484f58; }
.form-group input:disabled { opacity: 0.5; cursor: not-allowed; }

.form-hint { font-size: 0.75rem; color: #484f58; margin-top: 0.25rem; }
.form-hint.warning { color: #c9a227; }

/* ===== Buttons ===== */
.btn {
  padding: 0.7rem 1.25rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #c9a227, #b8911f);
  color: #0d1117;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #d4ad2e, #c9a227);
  box-shadow: 0 0 20px rgba(201, 162, 39, 0.3);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e6edf3;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-danger {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  color: #f85149;
}
.btn-danger:hover { background: rgba(248, 81, 73, 0.2); }

.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.8rem; }

.btn-connect {
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.3);
  color: #58a6ff;
}
.btn-connect:hover {
  background: rgba(88, 166, 255, 0.2);
  border-color: rgba(88, 166, 255, 0.5);
}

/* ===== Alerts ===== */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}
.alert.visible { display: block; }
.alert-error {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  color: #f85149;
}
.alert-success {
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid rgba(63, 185, 80, 0.3);
  color: #3fb950;
}

/* ===== Info Rows ===== */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
}
.info-row + .info-row {
  border-top: 1px solid rgba(88, 166, 255, 0.06);
}
.info-label {
  font-size: 0.8rem;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.info-value { font-size: 0.95rem; color: #e6edf3; }

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-enabled { background: rgba(63, 185, 80, 0.15); color: #3fb950; }
.badge-disabled { background: rgba(139, 148, 158, 0.15); color: #8b949e; }
.badge-connected { background: rgba(88, 166, 255, 0.15); color: #58a6ff; }
.badge-current { background: rgba(201, 162, 39, 0.15); color: #c9a227; }

/* ===== Sessions ===== */
.session-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(88, 166, 255, 0.06);
}
.session-item:last-child { border-bottom: none; }
.session-info { flex: 1; }
.session-device { font-size: 0.9rem; color: #e6edf3; margin-bottom: 0.2rem; }
.session-meta { font-size: 0.75rem; color: #484f58; }

/* ===== Connections ===== */
.connection-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}
.connection-item + .connection-item {
  border-top: 1px solid rgba(88, 166, 255, 0.06);
}
.connection-info { display: flex; align-items: center; gap: 1rem; }
.connection-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}
.connection-icon svg { width: 22px; height: 22px; }
.connection-name { font-size: 0.95rem; color: #e6edf3; font-weight: 500; }
.connection-status { font-size: 0.8rem; color: #8b949e; }

/* ===== QR Code ===== */
.qr-container {
  text-align: center;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  margin-bottom: 1rem;
}
.qr-container img { max-width: 200px; border-radius: 8px; }
.manual-key {
  font-family: monospace;
  font-size: 0.85rem;
  color: #c9a227;
  word-break: break-all;
  padding: 0.5rem 0.75rem;
  background: rgba(201, 162, 39, 0.1);
  border-radius: 6px;
  margin-top: 0.75rem;
  display: inline-block;
}

/* ===== Backup Codes ===== */
.backup-codes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
}
.backup-code {
  font-family: monospace;
  font-size: 0.9rem;
  color: #e6edf3;
  padding: 0.5rem;
  background: rgba(13, 17, 23, 0.8);
  border: 1px solid rgba(88, 166, 255, 0.1);
  border-radius: 6px;
  text-align: center;
}

/* ===== Loading ===== */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(201, 162, 39, 0.3);
  border-top-color: #c9a227;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  flex-direction: column;
  gap: 1rem;
  color: #8b949e;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .account-layout { flex-direction: column; max-width: 100%; }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(88, 166, 255, 0.1);
    padding: 1rem 0;
  }
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 0 1rem;
    gap: 0.25rem;
  }
  .sidebar-link {
    padding: 0.5rem 1rem;
    border-left: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    font-size: 0.8rem;
  }
  .sidebar-link.active {
    border-left-color: transparent;
    border-bottom-color: #c9a227;
  }
  .sidebar-divider, .sidebar-back { display: none; }
  .main-content { padding: 1.5rem; }
}
