/* ===================== eTroniX — Auth + Profile (mirrors source auth.css exactly) ===================== */

/* ---- header avatar button ---- */
.iconbtn-user { overflow: hidden; padding: 0; }
.user-av {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; color: #fff;
  background: linear-gradient(180deg, var(--blue-bright), var(--blue));
}
.iconbtn-user:hover .user-av { filter: brightness(1.06); }

/* ---- auth page ---- */
.auth-wrap { display: flex; justify-content: center; padding: 40px 24px 64px; }
.auth-card { width: min(440px, 100%); padding: 30px 32px 28px; box-shadow: var(--sh-2); }
.auth-brand { display: flex; justify-content: center; margin-bottom: 18px; }
.auth-brand img { height: 42px; width: auto; }

.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--bg-2); border-radius: var(--r-sm); padding: 4px; margin-bottom: 22px; }
.auth-tabs button { height: 40px; border-radius: 9px; font-weight: 700; font-size: 14.5px; color: var(--ink-3); transition: all .15s; }
.auth-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }

/* Базовая система полей (.field / .field-grid / .col2) вынесена в components.css —
   она нужна и странице оформления заказа, которая auth.css не подключает. */

.auth-err { display: flex; align-items: center; gap: 8px; background: var(--red-soft); color: var(--red); font-size: 13px; font-weight: 600; padding: 10px 12px; border-radius: 10px; }
.auth-err svg { width: 15px; height: 15px; flex: 0 0 auto; }
.auth-hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; margin: 2px 0 0; text-align: center; }
.auth-hint b { color: var(--ink-2); }

.auth-or { display: flex; align-items: center; gap: 14px; margin: 20px 0; color: var(--ink-4); font-size: 12.5px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.auth-social { display: flex; flex-direction: column; gap: 10px; }
.sso-google { font-weight: 700; }
.goog-g {
  font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 17px;
  background: linear-gradient(135deg, #4285F4 25%, #EA4335 25% 50%, #FBBC05 50% 75%, #34A853 75%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.goog-g.sm { font-size: 18px; }
.sso-tg { background: linear-gradient(180deg, #34a8e0, #1f8fc6); color: #fff; box-shadow: 0 8px 22px rgba(31,143,198,.28); font-weight: 700; }
.sso-tg:hover { filter: brightness(1.05); }
.sso-tg svg { width: 19px; height: 19px; }

/* ---- confirm step ---- */
.auth-confirm { display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; }
.auth-back { position: absolute; top: 14px; left: 14px; width: 34px; height: 34px; }
.code-input {
  width: 100%; height: 58px; border: 1.5px solid var(--line-2); border-radius: 14px; text-align: center;
  font-size: 30px; font-weight: 800; letter-spacing: .5em; padding-left: .5em; background: var(--surface);
  margin: 6px 0 10px; color: var(--ink);
}
.code-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--glow-soft); }
.code-demo { font-size: 12px; color: var(--ink-3); background: var(--bg-2); padding: 7px 12px; border-radius: 8px; margin-bottom: 16px; }
.code-demo b { color: var(--blue); letter-spacing: .1em; }
.tg-ic { width: 58px; height: 58px; border-radius: 18px; margin-bottom: 14px; color: #fff; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, #34a8e0, #1f8fc6); box-shadow: 0 10px 28px rgba(31,143,198,.35); }
.tg-ic svg { width: 30px; height: 30px; }
.tg-sub { font-size: 14px; color: var(--ink-3); line-height: 1.5; max-width: 300px; margin: 0 auto 18px; }
.tg-waiting { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px 0; }
.tg-spinner { width: 44px; height: 44px; border: 3px solid var(--line-2); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tg-fine { font-size: 11.5px; color: var(--ink-4); text-align: center; margin-top: 14px; }

/* ---- google modal ---- */
.goog-modal { width: min(400px, 94vw); padding: 26px 26px 18px; position: relative; box-shadow: var(--sh-3); animation: fadeUp .2s ease both; }
.goog-head { text-align: center; margin-bottom: 18px; }
.goog-head .goog-g { font-size: 34px; display: inline-block; margin-bottom: 8px; }
.goog-head h3 { font-size: 19px; }
.goog-head p { color: var(--ink-3); font-size: 13.5px; margin: 5px 0 0; }
.goog-list { display: flex; flex-direction: column; gap: 8px; }
.goog-acc { display: flex; align-items: center; gap: 13px; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r-sm); text-align: left; transition: all .15s; }
.goog-acc:hover { border-color: var(--blue); background: var(--blue-soft); }
.goog-av { width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; background: #5b6b8c; }
.goog-acc-t { display: flex; flex-direction: column; min-width: 0; }
.goog-acc-t b { font-size: 14.5px; }
.goog-acc-t em { font-style: normal; font-size: 12.5px; color: var(--ink-3); }
.goog-other { display: flex; gap: 8px; margin-top: 4px; }
.goog-other input { flex: 1; height: 42px; border: 1.5px solid var(--line-2); border-radius: 11px; padding: 0 13px; font-size: 13.5px; font-family: inherit; outline: none; }
.goog-other input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px var(--glow-soft); }
.goog-other .btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- modal shared ---- */
/* .modal-overlay вынесен в components.css (нужен и на странице корзины). */
.req-close { position: absolute; top: 14px; right: 14px; }

/* ---- profile page ---- */
.pf-page { padding-top: 26px; padding-bottom: 56px; }
.pf-hero {
  display: flex; align-items: center; gap: 20px; padding: 24px 26px; margin-bottom: 26px;
  background: radial-gradient(120% 160% at 0% 0%, var(--blue-soft) 0%, var(--surface) 55%);
}
.pf-avatar {
  width: 68px; height: 68px; border-radius: 20px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; color: #fff;
  background: linear-gradient(180deg, var(--blue-bright), var(--blue)); box-shadow: var(--sh-blue);
}
.pf-hero-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.pf-hero-t h1 { font-size: 26px; letter-spacing: -0.02em; }
.pf-hero-t .mono { font-size: 13px; color: var(--ink-2); }
.pf-since { color: var(--ink-4) !important; font-size: 12px !important; }
.pf-logout { flex: 0 0 auto; padding: 0 10px !important; }
.pf-logout svg { transform: scaleX(-1); }

.pf-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .pf-grid { grid-template-columns: 1fr; } }
.pf-h { font-size: 14px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin: 0 0 12px 2px; font-family: var(--ff-mono); font-weight: 700; }
.pf-card { overflow: hidden; }

.pf-row { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.pf-row:last-child { border-bottom: none; }
.pf-row-ic { width: 42px; height: 42px; border-radius: 12px; flex: 0 0 auto; background: var(--bg-2); color: var(--blue); display: flex; align-items: center; justify-content: center; }
.pf-row-ic svg { width: 21px; height: 21px; }
.pf-row-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pf-row-t b { font-size: 15px; font-weight: 700; }
.pf-row-t span { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-row-act { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.pf-status { font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 7px; font-family: var(--ff-mono); }
.pf-status.ok { background: var(--green-soft); color: var(--green); }
.pf-dim { font-size: 13px; color: var(--ink-3); }

.pf-pass { border-bottom: 1px solid var(--line); }
.pf-pass .pf-row { border-bottom: none; }
.pf-pass-form { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 12px; }

.pf-note { display: flex; align-items: flex-start; gap: 11px; margin-top: 14px; padding: 14px 16px; background: var(--amber-soft); border-radius: var(--r-md); font-size: 13px; line-height: 1.5; color: #7a5600; }
.pf-note svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--amber); margin-top: 1px; }
.pf-note b { color: #5e4300; }

.pf-link { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; transition: background .15s; }
.pf-link:last-child { border-bottom: none; }
.pf-link:hover { background: var(--surface-2); }
.pf-link:hover .pf-chev { transform: translateX(3px); }
.pf-chev { width: 18px; height: 18px; color: var(--ink-4); transition: transform .15s; flex: 0 0 auto; }

/* ---- TG connect modal (used in profile + favorites) ---- */
.tg-modal { width: min(460px, 94vw); padding: 30px 30px 24px; position: relative; display: flex; flex-direction: column; align-items: center; box-shadow: var(--sh-3); animation: fadeUp .2s ease both; }
.tg-steps { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 18px; width: 100%; text-align: left; }
.tg-steps li { display: flex; gap: 14px; align-items: flex-start; }
.tg-num { width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; margin-top: 1px; }
.tg-steps li > div { display: flex; flex-direction: column; gap: 9px; }
.tg-steps li b { font-size: 14.5px; font-weight: 700; }
.tg-open { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; text-decoration: none; }
.tg-open svg { width: 15px; height: 15px; }
.tg-code {
  display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
  height: 42px; padding: 0 8px 0 16px; border-radius: 11px; cursor: pointer;
  background: var(--surface-2, var(--bg-2)); border: 1.5px dashed var(--line-2); transition: all .15s;
}
.tg-code:hover { border-color: var(--blue); }
.tg-code.ok { border-style: solid; border-color: var(--green); }
.tg-code.ok svg, .tg-code.ok em { color: var(--green); }
.tg-code .mono { font-size: 17px; font-weight: 700; letter-spacing: .08em; color: var(--ink); }
.tg-code em { font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--blue); padding-right: 6px; }
.tg-code svg { width: 16px; height: 16px; color: var(--ink-3); }
.tg-input { height: 44px; border: 1.5px solid var(--line-2); border-radius: 11px; padding: 0 14px; font-size: 14.5px; background: var(--surface); width: 100%; font-family: inherit; outline: none; color: var(--ink); }
.tg-input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px var(--glow-soft); }
.tg-input::placeholder { color: var(--ink-4); }

/* ---- SSR-формы аккаунтов (auth.html / profile.html) ---- */
.auth-tabs a { height: 40px; border-radius: 9px; font-weight: 700; font-size: 14.5px; color: var(--ink-3); transition: all .15s; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.auth-tabs a.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.field-err { font-style: normal; font-size: 12px; font-weight: 600; color: var(--red); }
.auth-hint a { color: var(--blue); font-weight: 600; text-decoration: none; }
.auth-hint a:hover { text-decoration: underline; }
.auth-social .btn[disabled] { opacity: .55; cursor: not-allowed; }
.pf-card-title { font-size: 17px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
a.pf-row { color: inherit; text-decoration: none; }
a.pf-row:hover { background: var(--bg-2); }
.pf-card .auth-form { padding: 16px 18px 18px; }
@media (max-width: 860px) { .pf-grid { grid-template-columns: 1fr; } }

/* --- Привязки (профиль) --- */
.pf-bind { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.pf-bind:last-child { border-bottom: 0; }
.pf-bind-main { flex: 1; min-width: 0; }
.pf-bind-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pf-bind-head b { font-size: 15px; font-weight: 700; }
.pf-badge { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 7px; font-family: var(--ff-mono); }
.pf-badge-ok { background: var(--green-soft); color: var(--green); }
.pf-badge-warn { background: #fff3e0; color: #c77700; }
.pf-badge-muted { background: var(--bg-2); color: var(--ink-4); }
/* ряд «поле + Сохранить + корзина» — корзина на одном уровне с кнопкой */
.pf-bind-row { display: flex; gap: 8px; align-items: center; }
.pf-bind-row .pf-inline-form { flex: 1; min-width: 0; }
.pf-inline-form { display: flex; gap: 8px; align-items: center; }
.pf-input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 9px; font: inherit; font-size: 14px; background: var(--bg); color: var(--ink); }
.pf-input:focus { outline: none; border-color: var(--accent, #2d6cdf); }
/* серая иконка-отвязка справа от карточки привязки */
.pf-unlink { flex: 0 0 auto; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg); color: var(--ink-4); cursor: pointer; transition: background .12s, color .12s; }
.pf-unlink:hover { background: var(--bg-2); color: var(--ink-3); }
.pf-unlink svg { width: 17px; height: 17px; }

/* --- Активность --- */
.pf-stats { display: flex; gap: 12px; padding: 16px 18px; }
.pf-stat { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: inherit; }
a.pf-stat:hover { background: var(--bg-2); }
.pf-stat-n { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.pf-stat-l { font-size: 12px; color: var(--ink-3); font-family: var(--ff-mono); }
