* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Helvetica Neue";
  color: #111827;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(249,115,22,.18), transparent 60%),
    radial-gradient(900px 500px at 85% 90%, rgba(251,146,60,.14), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, #fff7ed 35%, #f8fafc 100%);
}

a { color: inherit; text-decoration: none; }
small { color: #6b7280; }

:root{
  --accent: #f97316;   /* laranja */
  --accent2: #fb923c;  /* laranja claro */
  --border: #e5e7eb;
  --shadow: 0 14px 30px rgba(17,24,39,.08);
}

.container {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
}

.page {
  padding: 22px 0 40px;
}

/* ========== TOPBAR ========== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #ffffffcc;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
}

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 10px 20px rgba(249,115,22,.25);
}

.user-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: right;
}

.user-mini .meta {
  display: grid;
  gap: 2px;
}

.user-mini .meta strong {
  font-size: 14px;
}

.user-mini .meta span {
  font-size: 12px;
  color: #6b7280;
}

/* Avatar mini: suporta foto via background-image */
.avatar-mini {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #111827;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  overflow: hidden;

  background-image: var(--avatar);
  background-size: cover;
  background-position: center;
}

/* quando tem imagem, some com o texto */
.avatar-mini.avatar-has-image {
  color: transparent;
}

/* ========== LAYOUT (SIDEBAR + CONTENT) ========== */
.shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 22px;
  align-items: start;
}

.sidebar-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 12px;
  color: #374151;
  transition: .15s ease;
}

.nav a:hover {
  background: #fff7ed;
}

.nav a.active {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent2) 100%);
  color: white;
  box-shadow: 0 14px 26px rgba(249,115,22,.22);
}

.nav .danger { color: #ef4444; }
.nav .danger:hover { background: #fee2e2; }

.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
}

.content {
  display: grid;
  gap: 16px;
}

.h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 4px 0 0;
  color: #6b7280;
}

/* ========== CARDS / PANELS ========== */
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
}

.panel-body {
  padding: 18px;
}

.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.kv {
  display: grid;
  gap: 6px;
}

.kv span { color: #6b7280; font-size: 13px; }
.kv strong { font-size: 14px; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  width: fit-content;
}

.badge-ok { background: #22c55e; color: #fff; }
.badge-warn { background: #f59e0b; color: #111827; }
.badge-danger { background: #ef4444; color: #fff; }

/* ========== PROFILE HEADER CARD ========== */
.profile-top {
  display: flex;
  gap: 16px;
  align-items: center;
}

/* Avatar grande: suporta foto via background-image */
.profile-photo {
  width: 74px;
  height: 74px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(0,0,0,.18);

  background-image: var(--avatar);
  background-size: cover;
  background-position: center;
}

.profile-photo.avatar-has-image { color: transparent; }

.profile-title {
  display: grid;
  gap: 6px;
}

.profile-title h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.profile-title p {
  margin: 0;
  color: #6b7280;
}

/* ========== GRADIENT STATS (AGORA LARANJA/BRANCO) ========== */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.stat {
  border-radius: 16px;
  padding: 18px;
  color: #fff;
  box-shadow: 0 14px 26px rgba(17,24,39,.14);
  position: relative;
  overflow: hidden;
  min-height: 110px;
}

.stat .label { font-size: 13px; opacity: .95; }
.stat .value { font-size: 34px; margin-top: 6px; font-weight: 900; letter-spacing: -0.02em; }
.stat .icon-big {
  position: absolute;
  right: 16px;
  top: 22px;
  width: 58px;
  height: 58px;
  opacity: .18;
}

.grad-purple { background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 60%, #fff 150%); }
.grad-green  { background: linear-gradient(135deg, var(--accent2) 0%, var(--accent) 60%, #fff 150%); }
.grad-pink   { background: linear-gradient(135deg, var(--accent) 0%, #ffd9c2 55%, #fff 160%); }
.grad-blue   { background: linear-gradient(135deg, var(--accent2) 0%, #ffe7d5 55%, #fff 160%); }
.grad-orange { background: linear-gradient(135deg, var(--accent) 0%, #ffb27f 55%, #fff 160%); }
.grad-red    { background: linear-gradient(135deg, #fb923c 0%, #f97316 55%, #fff 160%); }

/* ========== ACADEMICO / PROGRESS ========== */
.progress-box {
  padding: 16px 18px;
}

.progress-title {
  margin: 0;
  font-weight: 900;
}

.progress-sub {
  margin: 6px 0 14px;
  color: #6b7280;
  font-size: 13px;
}

.progress-track {
  height: 10px;
  background: #ffedd5;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent2) 100%);
}

/* ========== DISCIPLINAS LIST ========== */
.course-item {
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--border);
}

.course-left {
  display: grid;
  gap: 8px;
}

.course-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 18px;
}

.course-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: #6b7280;
  font-size: 13px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
}

.pill-blue { background: #ffedd5; color: #9a3412; }
.pill-green{ background: #dcfce7; color: #166534; }
.pill-gray { background: #f3f4f6; color: #374151; }

.grade {
  font-size: 30px;
  font-weight: 900;
  color: #10b981;
}

/* ========== FINANCEIRO ========== */
.pay-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.method {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: #fff;
}

.method .circle {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff7ed;
  border: 1px solid var(--border);
}

.method strong { display: block; }
.method span { color: #6b7280; font-size: 13px; }

/* Histórico */
.bill {
  padding: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bill-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bill-left .circle {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff7ed;
}

.bill-title strong { display: block; }
.bill-title span { display: block; color: #6b7280; font-size: 13px; margin-top: 2px; }

.bill-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.price {
  font-weight: 900;
  font-size: 18px;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent2) 100%);
  box-shadow: 0 12px 22px rgba(249,115,22,.22);
}

/* ========== CARTEIRINHA ========== */
.page-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #111827;
  font-weight: 900;
}

.small-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 900;
}

.center-title {
  text-align: center;
  font-weight: 900;
  font-size: 20px;
}

.card-virtual {
  width: min(920px, 100%);
  margin: 18px auto 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 16px 36px rgba(17,24,39,.10);
  background: #fff;
}

.card-virtual-top {
  padding: 18px 18px;
  color: #fff;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent2) 55%, #fff 130%);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-virtual-top .left {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.card-virtual-top .brand-badge{
  margin-top: 2px;          /* pode ajustar para 0, 1, 2, 3 */
  flex: 0 0 auto;
}
.card-virtual-top .left strong { display: block; font-size: 18px; }
.card-virtual-top .left span { display: block; font-size: 13px; opacity: .9; }

.year-bubble {
  width: 86px;
  height: 86px;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,.28);
  display: grid;
  place-items: center;
  position: relative;
}
.year-bubble .year {
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.25);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
}

.card-virtual-body {
  padding: 18px;
  display: grid;
  grid-template-columns: 140px 1fr 180px;
  gap: 18px;
  align-items: start;
}

.qr {
  width: 140px;
  height: 140px;
  border-radius: 14px;
  border: 2px solid var(--border);
  display: grid;
  place-items: center;
  background: #fff;
}

.card-info h3 {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
  letter-spacing: .06em;
}
.card-info h2 {
  margin: 6px 0 14px;
  font-size: 20px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.card-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  color: #6b7280;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
}

/* ========== LOGIN ========== */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(460px, 100%);
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 16px 36px rgba(17,24,39,.10);
  overflow: hidden;
}

.auth-head {
  padding: 18px;
  color: #fff;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent2) 55%, #fff 130%);
}

.auth-head strong { display: block; font-size: 18px; font-weight: 900; }
.auth-head span { display: block; font-size: 13px; opacity: .9; margin-top: 3px; }

.auth-body { padding: 18px; display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
label { font-size: 13px; color: #374151; font-weight: 900; }

input {
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  outline: none;
  font-size: 14px;
}
input:focus { border-color: #fdba74; box-shadow: 0 0 0 4px rgba(249,115,22,.15); }

.auth-actions { display: grid; gap: 10px; margin-top: 6px; }
.auth-actions .hint { color: #6b7280; font-size: 13px; }

.btn-full {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent2) 100%);
  box-shadow: 0 14px 26px rgba(249,115,22,.22);
}

/* ========== RESPONSIVO ========== */
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  .pay-methods { grid-template-columns: 1fr; }
  .card-virtual-body { grid-template-columns: 1fr; }
  .user-mini { display: none; }
}