/* ==========================================================================
   Central do Assinante — Silva Telecom  ·  v2 (design refinado)
   Tema do logo: navy profundo + laranja. Mobile-first (roda no app Android).
   ========================================================================== */

:root {
    --navy:        #23306b;   /* apoio / textos escuros */
    --navy-deep:   #14113a;
    --navy-2:      #2f2b78;
    --orange:      #ff6a2b;    /* COR PRIMÁRIA */
    --orange-2:    #ff8a3d;
    --grad:        linear-gradient(135deg, #ff8a3d 0%, #ff5a1f 100%);
    /* superfícies grandes (topbar, hero, login) agora em laranja (primária) */
    --grad-navy:   linear-gradient(150deg, #ff9048 0%, #f4590f 58%, #d8470a 100%);
    --grad-blue:   linear-gradient(155deg, #3f8cff 0%, #1657d0 100%); /* secundária */

    --ink:     #191826;
    --muted:   #6b7192;
    --line:    #eceef6;
    --bg:      #f2f3fa;
    --card:    #ffffff;

    --blue:    #3b74f5;   --blue-bg:   #eaf1ff;
    --green:   #17a673;   --green-bg:  #e5f7ef;
    --purple:  #7a5cff;   --purple-bg: #efe9ff;
    --orange-bg:#fff0e7;

    --ok:      #16a34a;   --ok-bg:     #e8f7ee;
    --warn:    #d97706;   --warn-bg:   #fdf1de;
    --danger:  #e0393b;   --danger-bg: #fdeaea;

    --r:       18px;
    --shadow:  0 10px 30px rgba(28, 26, 66, .10);
    --shadow-sm: 0 4px 14px rgba(28, 26, 66, .07);
    --shadow-orange: 0 10px 22px rgba(255, 90, 31, .30);

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased; color: var(--ink); background: var(--bg);
}
body { overflow-x: hidden; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: var(--orange); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ============================ LOGIN ============================ */
.login {
    min-height: 100%; display: flex; flex-direction: column;
    background: var(--grad-navy); color: #fff;
    padding: calc(var(--safe-top) + 8px) 24px calc(var(--safe-bottom) + 24px);
    position: relative; overflow: hidden;
}
.login::before {
    content: ''; position: absolute; top: -120px; right: -100px;
    width: 320px; height: 320px; border-radius: 50%;
    background: var(--grad); opacity: .28; filter: blur(10px);
}
.login__brand { flex: 0 0 auto; padding-top: 54px; text-align: center; position: relative; z-index: 1; }
.login__brand img { height: 64px; margin: 0 auto 10px; }
.login__brand p { color: rgba(255,255,255,.82); font-size: 14px; letter-spacing: .3px; }

.login__card {
    margin-top: auto; background: var(--card); color: var(--ink);
    border-radius: 26px; padding: 28px 22px 24px; box-shadow: var(--shadow); position: relative; z-index: 1;
}
.login__card h1 { font-size: 22px; margin-bottom: 4px; }
.login__card .sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #3a3b52; }
.field input, .field textarea, .field select {
    width: 100%; padding: 14px 15px; border: 1.5px solid var(--line); border-radius: 13px;
    font-size: 16px; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none; border-color: var(--navy-2); box-shadow: 0 0 0 4px rgba(47,43,120,.10);
}
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

.btn {
    width: 100%; padding: 15px 18px; border-radius: 13px; font-size: 16px; font-weight: 700;
    color: #fff; background: var(--grad); box-shadow: var(--shadow-orange);
    transition: transform .08s, opacity .15s; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; box-shadow: none; }
.btn--ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--line); box-shadow: none; }
.btn--navy { background: var(--blue); box-shadow: 0 8px 18px rgba(31,111,235,.30); }
.btn--sm { width: auto; padding: 11px 16px; font-size: 14px; border-radius: 11px; box-shadow: none; }
.btn--block { width: 100%; }

.login__demo { text-align: center; margin-top: 16px; }
.login__demo button { color: var(--navy); font-weight: 700; font-size: 14px; }
.login__foot { text-align: center; color: rgba(255,255,255,.82); font-size: 12px; margin-top: 22px; position: relative; z-index: 1; }
.login__foot a { color: #fff; text-decoration: underline; }

/* ============================ APP SHELL ============================ */
.app { display: none; min-height: 100%; flex-direction: column; }
.app.active { display: flex; }

.topbar {
    background: var(--grad-navy); color: #fff;
    padding: calc(var(--safe-top) + 16px) 18px 18px;
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 20;
    box-shadow: 0 6px 20px rgba(20,17,58,.22);
}
.topbar img.logo { height: 40px; }              /* LOGO MAIOR */
.topbar .who { margin-left: auto; text-align: right; line-height: 1.25; }
.topbar .who span.hi { font-size: 12px; color: rgba(255,255,255,.72); display: block; }
.topbar .who b { font-size: 15px; }
.topbar .avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,.16); border: 1.5px solid rgba(255,255,255,.25);
    display: grid; place-items: center; font-weight: 800; font-size: 15px;
}

main.content { flex: 1; padding: 18px 16px calc(96px + var(--safe-bottom)); max-width: 660px; width: 100%; margin: 0 auto; }
.page { display: none; animation: fade .2s ease; }
.page.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page__title { font-size: 22px; font-weight: 800; margin-bottom: 2px; letter-spacing: -.3px; }
.page__sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

.section-h { display: flex; align-items: center; justify-content: space-between; margin: 24px 2px 12px; }
.section-h h2 { font-size: 16px; letter-spacing: -.2px; }
.section-h a, .section-h button { font-size: 13px; font-weight: 700; color: var(--orange); }

.card { background: var(--card); border: 1px solid rgba(28,26,66,.05); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow-sm); margin-bottom: 14px; }

/* ---------- banner de avisos / promoções ---------- */
.avisos { margin-bottom: 14px; }
.avisos:empty { display: none; }
.avisos__track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -2px; padding: 2px; scrollbar-width: none; }
.avisos__track::-webkit-scrollbar { display: none; }
.aviso {
    flex: 0 0 100%; scroll-snap-align: center; position: relative; overflow: hidden;
    border-radius: var(--r); padding: 18px 44px 18px 18px; color: #fff; min-height: 96px;
    display: flex; flex-direction: column; justify-content: center; box-shadow: var(--shadow-sm);
}
.aviso--promo { background: var(--grad); }
.aviso--aviso { background: var(--grad-blue); }
.aviso::after { content: ''; position: absolute; right: -30px; bottom: -40px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.14); }
.aviso__tag { font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; opacity: .85; position: relative; z-index: 1; }
.aviso__title { font-size: 17px; font-weight: 800; margin: 3px 0 2px; position: relative; z-index: 1; }
.aviso__text { font-size: 13px; opacity: .92; line-height: 1.4; position: relative; z-index: 1; }
.aviso__cta { margin-top: 10px; align-self: flex-start; background: rgba(255,255,255,.22); color: #fff; font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: 10px; position: relative; z-index: 1; }
.aviso__close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.2); color: #fff; font-size: 15px; line-height: 1; display: grid; place-items: center; }
.avisos__dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.avisos__dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: .2s; }
.avisos__dots i.on { background: var(--orange); width: 18px; border-radius: 3px; }

/* ---------- seletor de contratos ---------- */
.contract-switch { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px; scrollbar-width: none; }
.contract-switch::-webkit-scrollbar { display: none; }
.contract-chip {
    flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    padding: 10px 14px; border-radius: 14px; background: #fff; border: 1.5px solid var(--line);
    min-width: 150px; text-align: left; transition: .15s;
}
.contract-chip .cc-plan { font-size: 14px; font-weight: 800; color: var(--navy); }
.contract-chip .cc-addr { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.contract-chip.active { border-color: var(--orange); background: var(--orange-bg); box-shadow: 0 6px 16px rgba(255,90,31,.14); }

/* ---------- hero do plano ---------- */
.hero {
    position: relative; overflow: hidden; border-radius: 22px; color: #fff;
    background: var(--grad-navy); padding: 20px; box-shadow: var(--shadow); margin-bottom: 6px;
}
.hero::before { content: ''; position: absolute; right: -50px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: var(--grad); opacity: .22; }
.hero__signal { position: absolute; right: 16px; bottom: 12px; opacity: .18; }
.hero__top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.hero__plan { font-size: 15px; font-weight: 700; color: rgba(255,255,255,.85); }
.hero__speed { position: relative; z-index: 1; font-size: 46px; font-weight: 800; line-height: 1; margin: 8px 0 2px; letter-spacing: -1px; }
.hero__speed small { font-size: 16px; font-weight: 700; color: rgba(255,255,255,.82); }
.hero__meta { display: flex; gap: 22px; margin-top: 18px; position: relative; z-index: 1; }
.hero__meta .k { font-size: 11px; color: rgba(255,255,255,.72); text-transform: uppercase; letter-spacing: .4px; }
.hero__meta .v { font-size: 15px; font-weight: 700; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge--ok { color: var(--ok); background: var(--ok-bg); }
.badge--warn { color: var(--warn); background: var(--warn-bg); }
.badge--danger { color: var(--danger); background: var(--danger-bg); }
.badge--live { color: #fff; background: rgba(255,255,255,.16); }
.badge--live .dot { background: #45e08a; box-shadow: 0 0 0 0 rgba(69,224,138,.7); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(69,224,138,0); } 100% { box-shadow: 0 0 0 0 rgba(69,224,138,0); } }

/* ---------- atalhos ---------- */
.shortcuts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.shortcut {
    background: var(--card); border: 1px solid rgba(28,26,66,.05); border-radius: var(--r); padding: 16px;
    box-shadow: var(--shadow-sm); text-align: left; display: flex; flex-direction: column; gap: 10px; transition: transform .08s;
}
.shortcut:active { transform: scale(.97); }
.shortcut .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; }
.shortcut .ico svg { width: 23px; height: 23px; }
.ico--orange { background: var(--orange-bg); color: var(--orange); }
.ico--blue   { background: var(--blue-bg);   color: var(--blue); }
.ico--green  { background: var(--green-bg);  color: var(--green); }
.ico--purple { background: var(--purple-bg); color: var(--purple); }
.shortcut b { font-size: 15px; }
.shortcut span { font-size: 12px; color: var(--muted); }

/* ---------- linha (conexão / wifi) ---------- */
.tile { display: flex; align-items: center; gap: 14px; }
.tile .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: 0 0 auto; }
.tile .ico svg { width: 23px; height: 23px; }
.tile .grow { flex: 1; min-width: 0; }
.tile b { font-size: 15px; }
.tile .sub { font-size: 13px; color: var(--muted); }

/* ---------- faturas ---------- */
.invoice { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--card); border: 1px solid rgba(28,26,66,.05); border-radius: 15px; box-shadow: var(--shadow-sm); margin-bottom: 10px; }
.invoice .month { width: 48px; height: 48px; border-radius: 13px; flex: 0 0 auto; background: #f0eefb; color: var(--navy); display: grid; place-items: center; text-align: center; line-height: 1; }
.invoice .month b { font-size: 15px; } .invoice .month span { font-size: 10px; }
.invoice .info { flex: 1; min-width: 0; }
.invoice .info b { font-size: 15px; }
.invoice .info span { display: block; font-size: 12px; color: var(--muted); }
.chip-mini { display: inline-block; font-size: 10px; font-weight: 700; color: var(--navy); background: #eeecfa; padding: 2px 7px; border-radius: 6px; margin-top: 3px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.open-invoice { border: none; color: #fff; background: var(--grad-blue); position: relative; overflow: hidden; }
.open-invoice::after { content: ''; position: absolute; right: -30px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: var(--grad); opacity: .2; }
.open-invoice .oi-label { font-size: 13px; color: rgba(255,255,255,.82); position: relative; z-index: 1; }
.open-invoice .oi-value { font-size: 30px; font-weight: 800; position: relative; z-index: 1; }
.open-invoice .oi-addr { font-size: 12px; color: rgba(255,255,255,.75); position: relative; z-index: 1; margin-top: 2px; }

.pixbox { background: #f8f8fc; border: 1px dashed var(--line); border-radius: 13px; padding: 14px; }
.pixbox.on-dark { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); position: relative; z-index: 1; }
.pixbox .code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; line-height: 1.5; max-height: 66px; overflow: hidden; color: #444; }
.pixbox.on-dark .code { color: rgba(255,255,255,.9); }
.copy-row { display: flex; gap: 10px; margin-top: 12px; }

/* ---------- chamados ---------- */
.ticket { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--card); border: 1px solid rgba(28,26,66,.05); border-radius: 15px; box-shadow: var(--shadow-sm); margin-bottom: 10px; }
.ticket .tdot { width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto; display: grid; place-items: center; }
.ticket .tdot svg { width: 20px; height: 20px; }
.ticket .grow { flex: 1; min-width: 0; }
.ticket b { font-size: 14.5px; display: block; }
.ticket .meta { font-size: 12px; color: var(--muted); }

/* ---------- velocidade ---------- */
.speed { text-align: center; padding: 8px 0 4px; }
.gauge { position: relative; width: 220px; height: 220px; margin: 6px auto 4px; }
.gauge svg { transform: rotate(-90deg); }
.gauge .num { position: absolute; inset: 0; display: grid; place-content: center; }
.gauge .num b { font-size: 46px; font-weight: 800; line-height: 1; }
.gauge .num span { font-size: 14px; color: var(--muted); }
.speed-metrics { display: flex; justify-content: center; gap: 26px; margin: 10px 0 18px; }
.speed-metrics .m b { font-size: 20px; } .speed-metrics .m span { font-size: 12px; color: var(--muted); display: block; }

/* ---------- doc / faq ---------- */
.doc { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 18px; font-size: 13.5px; line-height: 1.65; color: #414258; max-height: 340px; overflow-y: auto; }
.doc h4 { color: var(--navy); margin: 14px 0 6px; font-size: 14px; } .doc h4:first-child { margin-top: 0; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px; background: #f8f8fc; border-radius: 12px; margin: 14px 0; }
.check input { width: 20px; height: 20px; margin-top: 1px; flex: 0 0 auto; accent-color: var(--orange); }
.check label { font-size: 13.5px; color: #414258; }

.faq { background: var(--card); border: 1px solid rgba(28,26,66,.05); border-radius: 13px; box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 10px; }
.faq summary { padding: 15px 16px; font-weight: 600; font-size: 14.5px; list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--orange); font-size: 20px; }
.faq[open] summary::after { content: '–'; }
.faq p { padding: 0 16px 16px; font-size: 13.5px; color: var(--muted); line-height: 1.6; }

.wa-btn { display: flex; align-items: center; gap: 12px; justify-content: center; background: #25D366; color: #fff; font-weight: 700; padding: 16px; border-radius: 14px; font-size: 15px; box-shadow: 0 10px 22px rgba(37,211,102,.28); }
.wa-btn svg { width: 22px; height: 22px; }

/* ============================ BOTTOM NAV ============================ */
.tabbar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: rgba(255,255,255,.97); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    display: flex; justify-content: space-around; padding: 8px 4px calc(8px + var(--safe-bottom));
}
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 600; padding: 5px 0; position: relative; }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button.active { color: var(--navy); }
.tabbar button.active svg { color: var(--orange); }
.tabbar button.active::before { content: ''; position: absolute; top: -8px; width: 26px; height: 3px; border-radius: 3px; background: var(--orange); }

/* ============================ TOAST / SHEET ============================ */
.toast { position: fixed; left: 50%; bottom: calc(104px + var(--safe-bottom)); transform: translateX(-50%) translateY(20px); background: var(--navy-deep); color: #fff; padding: 13px 18px; border-radius: 13px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); z-index: 60; opacity: 0; pointer-events: none; transition: .25s; max-width: 90%; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(15,14,38,.55); z-index: 50; opacity: 0; pointer-events: none; transition: .2s; }
.sheet-backdrop.show { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: #fff; border-radius: 24px 24px 0 0; padding: 22px 20px calc(22px + var(--safe-bottom)); transform: translateY(100%); transition: transform .3s cubic-bezier(.2,.9,.3,1); max-height: 90vh; overflow-y: auto; }
.sheet.show { transform: translateY(0); }
.sheet .grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: -6px auto 16px; }
.sheet h3 { font-size: 19px; margin-bottom: 4px; }

.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 14px; }
