/* Toast, login/cadastro, conta, gestão de usuários e senha */
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 15px; }
.toast { position: fixed; z-index: 150; bottom: 24px; right: 24px; max-width: calc(100vw - 36px); background: #20292b; color: #e8fff4; border: 1px solid #2ccc8c44; border-radius: 12px; padding: 13px 16px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; transform: translateY(20px); opacity: 0; pointer-events: none; transition: .25s ease; font-size: 12px; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast svg { width: 17px; height: 17px; color: #42dda0; }

/* Authentication and account management */
body:not(.authenticated) .app, body:not(.authenticated) .mobile-nav { display: none !important; }
.auth-screen { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 22px; overflow-y: auto; background-color: #060819; background-image: linear-gradient(90deg, rgba(5,7,20,.12) 0%, rgba(5,7,20,.18) 48%, rgba(5,7,20,.12) 100%), url("../login-background.jpg"); background-size: cover; background-position: center; background-repeat: no-repeat; }
.auth-screen::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 26%, rgba(3,5,15,.20) 100%); }
.auth-planet { position:absolute; z-index:0; left:clamp(-44px, 1.5vw, 36px); top:50%; width:min(43vw, 620px); aspect-ratio:1; transform:translateY(-50%); pointer-events:none; opacity:.98; isolation:isolate; }
.auth-planet canvas { position:relative; z-index:1; display:block; width:100%; height:100%; overflow:visible; filter:drop-shadow(0 0 30px rgba(95,55,255,.24)); }
.planet-orbit { position:absolute; z-index:2; left:50%; top:50%; display:block; pointer-events:none; border-radius:50%; transform-origin:center; }
.planet-orbit.one { width:94%; height:31%; border:1px dashed rgba(135,103,255,.72); box-shadow:0 0 10px rgba(105,66,255,.12); animation:planet-orbit-one 42s linear infinite; }
.planet-orbit.two { width:91%; height:43%; border:1px solid rgba(94,70,255,.36); transform:translate(-50%,-50%) rotate(29deg); animation:planet-orbit-two 58s linear infinite; }
.planet-orbit::after { content:""; position:absolute; top:48%; left:13%; width:7px; height:7px; border-radius:50%; background:#e5dcff; box-shadow:0 0 9px 3px rgba(142,102,255,.8); }
.planet-orbit.two::after { top:17%; left:76%; width:5px; height:5px; background:#aa91ff; box-shadow:0 0 8px 2px rgba(124,88,255,.8); }
@keyframes planet-orbit-one { from { transform:translate(-50%,-50%) rotate(-23deg); } to { transform:translate(-50%,-50%) rotate(337deg); } }
@keyframes planet-orbit-two { from { transform:translate(-50%,-50%) rotate(29deg); } to { transform:translate(-50%,-50%) rotate(389deg); } }
@media (max-width:880px) { .auth-planet { width:min(74vw, 440px); left:-20vw; top:43%; opacity:.60; } }
@media (max-width:540px) { .auth-planet { width:78vw; left:-34vw; top:15%; opacity:.42; } }
@media (prefers-reduced-motion:reduce) { .planet-orbit { animation:none !important; } }
body.authenticated .auth-screen { display: none; }
.auth-card { position: relative; z-index: 1; width: min(100%, 478px); padding: clamp(30px, 2.35vw, 42px); border-radius: 25px; border: 1px solid rgba(132,91,255,.52); background: linear-gradient(145deg, rgba(7,12,35,.91), rgba(4,8,27,.89)); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); box-shadow: 0 30px 100px rgba(0,0,0,.60), 0 0 55px rgba(100,54,255,.16), inset 0 1px 0 rgba(255,255,255,.09); }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 23px; }
.auth-card .brand-mark { flex: 0 0 66px; width: 66px; height: 66px; border-radius: 17px; background: linear-gradient(145deg, #9465ff, #5d32df); box-shadow: 0 8px 28px rgba(103,65,245,.36), inset 0 1px 0 rgba(255,255,255,.28); }
.auth-card .brand-mark svg { width: 41px; height: 41px; }
.auth-brand .brand-name { font-size: 22px; line-height: 1.04; letter-spacing: -.6px; }
.auth-card h1 { font-size: 27px; letter-spacing: -.8px; }
.auth-card .subtitle { line-height: 1.6; margin: 9px 0 23px; color: #aeb7d0; }
.auth-card .eyebrow { color: #a58aff; }
.auth-form { display: grid; gap: 16px; }
.auth-form label { display: grid; gap: 7px; color: #c6cbe0; font-size: 12px; font-weight: 650; }
.auth-form input { min-width: 0; width: 100%; background: rgba(21,29,67,.76); color: #f4f5ff; border: 1px solid rgba(129,120,255,.20); border-radius: 12px; padding: 13px 14px; outline: none; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.auth-input-shell { position: relative; display: block; }
.auth-input-shell > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #a5a6df; pointer-events: none; }
.auth-form .auth-input-shell input { height: 49px; padding-left: 43px; padding-right: 42px; }
.auth-password-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; color: #aeb8e8; background: transparent; }
.auth-password-toggle:hover { background: #ffffff0b; color: white; }
.auth-password-toggle svg { width: 18px; height: 18px; }
.auth-error:empty { display: none; }
.auth-form input::placeholder { color: #7e89b0; }
.auth-form input:focus { border-color: #9474ff; background: rgba(27,35,79,.9); box-shadow: 0 0 0 3px rgba(124,86,255,.13); }
.auth-form .btn { width: 100%; margin-top: 5px; min-height: 50px; background: linear-gradient(110deg, #8b50ff, #642cff); box-shadow: 0 10px 28px rgba(102,45,255,.28), inset 0 1px 0 rgba(255,255,255,.17); }
.auth-form .btn:hover { filter: brightness(1.12); box-shadow: 0 13px 34px rgba(102,45,255,.36); }
.auth-error { color: #ff9cad; font-size: 12px; min-height: 15px; line-height: 1.5; }
.auth-note { color: #8c97ba; font-size: 10px; line-height: 1.6; margin-top: 19px; border-top: 1px solid rgba(163,144,255,.16); padding-top: 14px; }
.auth-privacy-wrap { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.auth-privacy-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 13px; color: #c9bdff; font-size: 11px; font-weight: 650; text-decoration: none; border: 1px solid rgba(151,125,255,.28); border-radius: 10px; background: rgba(93,67,173,.12); transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.auth-privacy-link:hover { color: #fff; background: rgba(111,79,217,.22); border-color: rgba(171,147,255,.55); transform: translateY(-1px); }
.auth-privacy-link:focus-visible, .footer a:focus-visible { outline: 2px solid var(--purple-2); outline-offset: 3px; }
.auth-privacy-link svg { width: 14px; height: 14px; flex: 0 0 auto; }
.footer-links { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }
.footer a { color: #9f99ff; text-decoration: none; }
.footer a:hover { color: #c9c5ff; text-decoration: underline; }
.account-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 14px; margin: -12px 0 21px; border: 1px solid #ffffff0c; border-radius: 13px; background: #161b20; }
.account-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.account-avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; background: linear-gradient(145deg,#7770ff,#4c48ce); color: white; font-weight: 800; font-size: 12px; }
.account-name { color: #e9ebf2; font-weight: 750; font-size: 12px; }
.account-role { color: #8b94a1; font-size: 10px; margin-top: 3px; }
.account-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.account-actions .btn { padding: 8px 10px; font-size: 10px; border-radius: 9px; }
.role-badge { display: inline-flex; padding: 4px 7px; border-radius: 6px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; background: #766bff20; color: #b3adff; }
.role-badge.admin { background: #22c9871c; color: #58dfa6; }
.role-badge.legacy { background: #22c9871c; color: #58dfa6; }
.role-badge.expired { background: #ff778f18; color: #ff96a8; }
.user-action-buttons button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.modal-wide { width: min(100%, 850px); }
.users-tools { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 15px; }
.users-tools p { margin: 0; color: #929aa6; font-size: 11px; flex: 1; line-height: 1.5; }
.users-table { min-width: 850px; }
.user-row-name { color: #e8eaf0; font-weight: 700; }
.user-row-sub { display: block; color: #777f8b; margin-top: 4px; font-size: 10px; }
.status-dot { display:inline-block; width:7px; height:7px; border-radius:50%; margin-right:6px; background:#4bd99b; }
.status-dot.off { background:#ff778f; }
.user-action-buttons { display: flex; gap: 4px; justify-content: flex-end; }
.user-action-buttons .btn { padding: 7px 9px; font-size: 10px; }
.checkbox-line { display:flex; align-items:center; gap:9px; color:#bec4cd; font-size:11px; }
.checkbox-line input { accent-color:var(--purple-2); width:16px; height:16px; }
.forced-password .modal-backdrop-close { display:none; }
@media (max-width: 540px) {
  .auth-screen { padding: 16px 13px; align-items: center; background-position: 27% center; }
  .auth-screen::before { background: rgba(3,5,15,.20); }
  .auth-card { border-radius: 21px; padding: 25px 20px; background: linear-gradient(145deg, rgba(7,12,35,.95), rgba(4,8,27,.95)); }
  .auth-card .brand-mark { flex-basis: 55px; width: 55px; height: 55px; border-radius: 15px; }
  .auth-card .brand-mark svg { width: 35px; height: 35px; }
  .auth-brand .brand-name { font-size: 19px; }
  .auth-brand { margin-bottom: 23px; gap: 12px; }
  .market-grid { grid-template-columns:1fr; }
  .market-insights { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .market-head { flex-direction:column; }
  .market-head-actions { justify-content:flex-start; }
  .account-bar { align-items: flex-start; margin-top: -9px; padding: 10px; }
  .account-actions { width: 100%; justify-content: stretch; }
  .account-actions .btn { flex: 1; }
  .users-tools { align-items: stretch; }
  .users-tools .btn { width: 100%; }
  .user-action-buttons { flex-wrap: wrap; }
}

.auth-signup-cta { margin-top: 15px; text-align: center; color: #a0a7bf; font-size: 12px; }
.auth-signup-cta a { color: #c6b8ff; font-weight: 750; text-decoration: none; margin-left: 4px; }
.auth-signup-cta a:hover { color: #fff; text-decoration: underline; }

/* ===== Darvix login (mockup) ===== */
.auth-card { width:min(100%, 440px); border-color:rgba(139,100,255,.5); background:linear-gradient(160deg, rgba(14,10,40,.93), rgba(6,4,22,.95)); box-shadow:0 0 0 1px rgba(139,100,255,.10), 0 30px 80px rgba(0,0,0,.55), 0 0 60px rgba(104,52,255,.16); }
.auth-card .brand-tile { width:78px; height:78px; border-radius:18px; }
.auth-brand .brand-lockup { height:62px; width:auto; display:block; }
.auth-brand { gap:16px; margin-bottom:22px; }
.auth-card .eyebrow { font-size:10px; letter-spacing:.2em; color:#b48cff; }
.auth-card h1 { font-size:26px; }
.auth-card .subtitle { font-size:13px; margin:8px 0 20px; }
.auth-form input { background:rgba(18,16,52,.8); border-color:rgba(139,100,255,.34); }
.auth-form .btn { display:inline-flex; align-items:center; justify-content:center; gap:10px; background:linear-gradient(110deg,#8a3dff,#6a2bff); }
.auth-form .btn .btn-arrow { width:16px; height:16px; }
.auth-privacy-link { background:rgba(20,14,58,.6); border-color:rgba(139,100,255,.35); border-radius:10px; }
.auth-showcase { position:absolute; z-index:0; left:clamp(18px,4vw,90px); top:clamp(24px,7vh,80px); width:clamp(190px,21vw,330px); pointer-events:none; filter:drop-shadow(0 0 26px rgba(120,60,255,.35)); }
.auth-showcase img { width:100%; height:auto; display:block; }
.auth-planet { top:65%; bottom:auto; transform:translateY(-50%); width:min(27vw,52vh,470px); left:clamp(0px,3vw,70px); }
@media (max-width:1100px) { .auth-showcase { display:none; } .auth-planet { top:50%; bottom:auto; transform:translateY(-50%); width:min(46vw,440px); } }
@media (max-width:880px) { .auth-planet { width:min(74vw,440px); left:-20vw; top:43%; opacity:.5; } }
@media (max-width:540px) {
  .auth-card .brand-tile { width:60px; height:60px; border-radius:15px; }
  .auth-brand .brand-lockup { height:48px; }
  .auth-planet { width:78vw; left:-34vw; top:15%; opacity:.4; }
}
