* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: light;
  --auth-bg: #f3efe9;
  --auth-card: #fffdf9;
  --auth-card-soft: #f8f4ee;
  --auth-text: #272220;
  --auth-muted: #7b716b;
  --auth-border: #e6ddd4;
  --auth-coral: #ef6b5b;
  --auth-coral-deep: #c94e43;
  --auth-jade: #39b398;
  --auth-error: #bd3c44;
  --auth-error-bg: #fff0f0;
  --auth-success: #19705d;
  --auth-success-bg: #e8f7f2;
  --auth-shadow: 0 30px 90px rgba(57, 42, 32, .16);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --auth-bg: #0c1312;
  --auth-card: #17211f;
  --auth-card-soft: #111a18;
  --auth-text: #f5efe8;
  --auth-muted: #aaa099;
  --auth-border: #2c3a36;
  --auth-coral: #ff8373;
  --auth-coral-deep: #ff9d91;
  --auth-jade: #53cdb4;
  --auth-error: #ff9298;
  --auth-error-bg: #3b2026;
  --auth-success: #78ddc2;
  --auth-success-bg: #17362f;
  --auth-shadow: 0 32px 100px rgba(0, 0, 0, .38);
}

body.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 7%, color-mix(in srgb, var(--auth-coral) 10%, transparent), transparent 27%),
    var(--auth-bg);
  color: var(--auth-text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  padding: clamp(12px, 3vw, 42px);
}

button, input { font: inherit; }

.auth-shell {
  width: min(1240px, 100%);
  min-height: calc(100vh - clamp(24px, 6vw, 84px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(440px, 1.08fr) minmax(400px, .92fr);
  border: 1px solid color-mix(in srgb, var(--auth-border) 72%, transparent);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--auth-shadow);
  background: var(--auth-card);
}

.auth-story {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 650px;
  display: flex;
  flex-direction: column;
  padding: clamp(32px, 5vw, 64px);
  color: #fff;
  background:
    radial-gradient(circle at 84% 16%, rgba(255, 126, 107, .32), transparent 27%),
    radial-gradient(circle at 18% 85%, rgba(64, 205, 173, .18), transparent 31%),
    linear-gradient(145deg, #112420 0%, #243532 54%, #55333a 115%);
}

.auth-story::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 470px;
  height: 470px;
  right: -245px;
  bottom: -230px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.018);
}

.auth-brand { display: flex; align-items: center; gap: 13px; }
.auth-brand > div { display: flex; flex-direction: column; gap: 2px; }
.auth-brand b { font-size: 15px; letter-spacing: -.01em; }
.auth-brand small { color: rgba(255,255,255,.54); font-size: 10.5px; text-transform: uppercase; letter-spacing: .11em; }

.auth-logo, .auth-mobile-logo {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 13px;
  background: linear-gradient(135deg, #ff816f, #efa85b);
  box-shadow: 0 10px 28px rgba(239, 107, 91, .28);
}
.auth-logo i, .auth-mobile-logo i { position: absolute; display: block; background: #fff; transform: rotate(-18deg); }
.auth-logo i:first-child, .auth-mobile-logo i:first-child { width: 8px; height: 22px; left: 13px; top: 10px; border-radius: 6px 6px 2px 2px; }
.auth-logo i:last-child, .auth-mobile-logo i:last-child { width: 8px; height: 15px; right: 12px; top: 16px; border-radius: 2px 2px 6px 6px; opacity: .76; }

.auth-story-copy { width: min(510px, 90%); margin-top: auto; margin-bottom: auto; padding: 70px 0 120px; }
.auth-kicker { display: inline-flex; align-items: center; gap: 9px; color: #7ee0c7; font-size: 10.5px; font-weight: 800; letter-spacing: .14em; }
.auth-kicker i { width: 7px; height: 7px; border-radius: 50%; background: #6dd9bd; box-shadow: 0 0 0 5px rgba(109,217,189,.11); }
.auth-story h1 { margin-top: 22px; font-size: clamp(36px, 4vw, 58px); line-height: 1.03; letter-spacing: -.047em; max-width: 560px; }
.auth-story-copy p { margin-top: 24px; max-width: 465px; color: rgba(255,255,255,.66); font-size: 15px; line-height: 1.65; }

.auth-trust { display: flex; gap: 28px; color: rgba(255,255,255,.56); font-size: 11px; }
.auth-trust span { display: flex; align-items: center; gap: 8px; }
.auth-trust span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #62cfb4; }

.auth-pulse { position: absolute; width: 250px; height: 250px; right: -12px; top: 47%; transform: translateY(-50%); opacity: .72; }
.pulse-orbit { position: absolute; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; }
.orbit-one { inset: 42px; }
.orbit-two { inset: 4px; border-style: dashed; animation: auth-spin 24s linear infinite; }
.pulse-center { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; transform: translate(-50%, -50%) rotate(45deg); border-radius: 18px; display: grid; place-items: center; background: linear-gradient(135deg, #ff806f, #cf5e56); box-shadow: 0 15px 50px rgba(239,107,91,.38); }
.pulse-center i { width: 16px; height: 16px; border: 4px solid rgba(255,255,255,.9); border-left-color: transparent; border-radius: 50%; }
.pulse-node { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #62d0b5; box-shadow: 0 0 0 7px rgba(98,208,181,.12); }
.node-one { left: 23px; top: 72px; }
.node-two { right: 19px; bottom: 71px; width: 8px; height: 8px; background: #ffc078; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-entry { position: relative; display: grid; place-items: center; padding: clamp(36px, 6vw, 78px); background: var(--auth-card); }
.auth-theme { position: absolute; right: 26px; top: 24px; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--auth-border); border-radius: 11px; color: var(--auth-muted); background: var(--auth-card-soft); cursor: pointer; transition: .16s ease; }
.auth-theme:hover { border-color: var(--auth-coral); color: var(--auth-coral); transform: translateY(-1px); }

.auth-form-wrap { width: min(390px, 100%); }
.auth-heading { margin-bottom: 32px; }
.auth-heading .auth-mobile-logo { display: none; margin-bottom: 24px; }
.auth-heading p { color: var(--auth-coral-deep); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.auth-heading h2 { margin: 10px 0 8px; font-size: clamp(28px, 3vw, 36px); line-height: 1.1; letter-spacing: -.035em; }
.auth-heading > span:last-child { color: var(--auth-muted); font-size: 13px; line-height: 1.55; }

.auth-form { display: flex; flex-direction: column; gap: 20px; }
.auth-form label { display: flex; flex-direction: column; gap: 8px; }
.auth-form label > span { color: var(--auth-text); font-size: 11.5px; font-weight: 750; }
.auth-input { min-height: 52px; display: flex; align-items: center; gap: 11px; padding: 0 14px; border: 1px solid var(--auth-border); border-radius: 13px; background: var(--auth-card-soft); transition: border-color .16s, box-shadow .16s, background .16s; }
.auth-input:focus-within { border-color: var(--auth-coral); background: var(--auth-card); box-shadow: 0 0 0 4px color-mix(in srgb, var(--auth-coral) 12%, transparent); }
.auth-input svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: var(--auth-muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.auth-input input { min-width: 0; width: 100%; height: 50px; border: 0; outline: 0; color: var(--auth-text); background: transparent; font-size: 14px; }
.auth-input input::placeholder { color: color-mix(in srgb, var(--auth-muted) 65%, transparent); }
.auth-password-toggle { border: 0; color: var(--auth-coral-deep); background: transparent; cursor: pointer; font-size: 10.5px; font-weight: 800; }

.auth-submit { min-height: 54px; margin-top: 5px; display: flex; align-items: center; justify-content: space-between; padding: 0 19px 0 22px; border: 0; border-radius: 13px; color: #fff; background: linear-gradient(125deg, #e85f51, #f28b62); box-shadow: 0 13px 28px rgba(222, 88, 74, .23); cursor: pointer; font-size: 13px; font-weight: 800; transition: transform .16s, box-shadow .16s; }
.auth-submit:hover { transform: translateY(-2px); box-shadow: 0 17px 35px rgba(222, 88, 74, .29); }
.auth-submit b { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.15); font-size: 16px; }

.auth-message { margin-bottom: 19px; padding: 12px 14px; border: 1px solid; border-radius: 11px; font-size: 12px; line-height: 1.5; }
.auth-message.erro { color: var(--auth-error); border-color: color-mix(in srgb, var(--auth-error) 24%, transparent); background: var(--auth-error-bg); }
.auth-message.sucesso { color: var(--auth-success); border-color: color-mix(in srgb, var(--auth-success) 24%, transparent); background: var(--auth-success-bg); }
.auth-footer { margin-top: 34px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--auth-muted); font-size: 10.5px; }
.auth-footer i { width: 6px; height: 6px; border-radius: 50%; background: var(--auth-jade); box-shadow: 0 0 0 4px color-mix(in srgb, var(--auth-jade) 12%, transparent); }

.auth-setup { padding: 22px; border: 1px solid var(--auth-border); border-radius: 16px; background: var(--auth-card-soft); }
.auth-setup-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 15px; border-radius: 12px; color: var(--auth-coral-deep); background: color-mix(in srgb, var(--auth-coral) 13%, var(--auth-card)); font-weight: 800; }
.auth-setup h3 { font-size: 17px; }
.auth-setup p { margin-top: 8px; color: var(--auth-muted); font-size: 12px; line-height: 1.55; }
.auth-setup code { display: block; overflow-x: auto; margin-top: 14px; padding: 12px; border: 1px solid var(--auth-border); border-radius: 9px; color: var(--auth-jade); background: #13211e; font-size: 11px; white-space: nowrap; }
.auth-setup .auth-setup-note { font-size: 10.5px; }

/* Troca de senha */
.password-page { display: grid; place-items: center; }
.password-shell { width: min(560px, 100%); }
.password-back { display: inline-flex; margin-bottom: 16px; color: var(--auth-muted); text-decoration: none; font-size: 12px; font-weight: 700; }
.password-back:hover { color: var(--auth-coral-deep); }
.password-card { padding: clamp(26px, 6vw, 46px); border: 1px solid var(--auth-border); border-radius: 22px; background: var(--auth-card); box-shadow: var(--auth-shadow); }
.password-card-head { display: flex; align-items: center; gap: 15px; }
.password-card-head small { color: var(--auth-coral-deep); font-size: 9.5px; font-weight: 800; letter-spacing: .13em; }
.password-card-head h1 { margin-top: 3px; font-size: 26px; letter-spacing: -.03em; }
.password-intro { margin: 22px 0 25px; color: var(--auth-muted); font-size: 12.5px; line-height: 1.6; }
.password-rule { margin-top: -6px; color: var(--auth-muted); font-size: 10.5px; line-height: 1.5; }

@media (max-width: 900px) {
  body.auth-page { padding: 0; }
  .auth-shell { min-height: 100vh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .auth-story { display: none; }
  .auth-entry { min-height: 100vh; padding: 72px 28px 42px; }
  .auth-heading .auth-mobile-logo { display: inline-block; }
  .password-page { padding: 20px; }
}

@media (max-width: 440px) {
  .auth-entry { padding-left: 21px; padding-right: 21px; }
  .auth-theme { right: 18px; top: 17px; }
  .auth-heading { margin-bottom: 26px; }
  .password-page { padding: 12px; }
  .password-card { border-radius: 18px; }
}

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