/* Sign-in / register screens. Scoped to .ta so it overrides the legacy .tesla-auth rules without touching them. */
body.tesla-auth { background: #fff !important; }

.ta {
  --ta-ink: #171a20;
  --ta-red: #e82127;
  --ta-grey: #5c5e62;
  --ta-line: #d0d1d2;
  --ta-soft: #f5f5f5;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100svh;
  font-family: "Universal Sans Text", "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ta-ink);
}
@media (min-width: 992px) {
  .ta { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .ta.ta--single { grid-template-columns: minmax(0, 1fr); }
}

/* Brand panel */
.ta__brand {
  display: none;
  position: relative;
  padding: 48px;
  color: #fff;
  background:
    radial-gradient(ellipse 80% 60% at 15% 15%, rgba(232,33,39,.25) 0%, rgba(232,33,39,0) 60%),
    linear-gradient(160deg, #171a20 0%, #22262f 55%, #171a20 100%);
  flex-direction: column;
  justify-content: space-between;
}
@media (min-width: 992px) { .ta__brand { display: flex; } }
.ta__brand-mark {
  font-family: "Universal Sans Display", "Helvetica Neue", sans-serif;
  letter-spacing: .28em;
  font-weight: 500;
  font-size: 18px;
  color: #fff !important;
  text-decoration: none !important;
}
.ta .ta__brand h2 { color: #fff !important; font-size: 34px; line-height: 40px; font-weight: 500; margin: 0 0 12px; }
.ta .ta__brand p { color: rgba(255,255,255,.88) !important; margin: 0; font-size: 15px; line-height: 23px; max-width: 420px; }
.ta__perks { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 14px; }
.ta__perks li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #fff; }
.ta__perk-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
}

/* Form panel */
.ta__main { display: flex; flex-direction: column; padding: 24px 20px 28px; background: #fff; }
@media (min-width: 576px) { .ta__main { padding: 32px 40px; } }
.ta__top { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; }
.ta__logo img { height: 32px; width: auto; max-width: 160px; display: block; }
.ta__logo { color: var(--ta-ink); text-decoration: none !important; }
.ta__logo .tesla-wordmark { font-size: 17px; }
.ta__top-link { font-size: 13px; color: var(--ta-grey) !important; }
.ta__top-link a { font-weight: 600; text-decoration: underline; }
.ta__card { width: 100%; max-width: 420px; margin: auto; padding: 32px 0; }
.ta__card--wide { max-width: 600px; }
.ta__title { font-family: "Universal Sans Display", "Helvetica Neue", sans-serif; font-size: 28px; line-height: 34px; font-weight: 500; margin: 0 0 6px; color: var(--ta-ink) !important; }
.ta .ta__title--spaced { margin-bottom: 24px; }
/* Placeholders carry the meaning visually; the label stays for screen readers and autofill. */
.ta .ta__label--hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.ta__lead { color: var(--ta-grey) !important; font-size: 14px; line-height: 21px; margin: 0 0 24px; }

/* Notices */
.ta__alert { display: flex; gap: 10px; align-items: flex-start; border-radius: 4px; padding: 12px 14px; font-size: 13px; line-height: 19px; margin-bottom: 20px; border: 1px solid var(--ta-line); background: var(--ta-soft); color: var(--ta-ink); }
.ta__alert .ta-icon { flex: none; margin-top: 1px; }
.ta__alert--error { background: #fdf0f0; border-color: #f3c3c5; color: #8f1318; }
.ta__alert ul { margin: 0; padding: 0; list-style: none; }

/* Fields */
.ta__section { margin: 0 0 14px; padding: 0; border: 0; }
.ta__grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 576px) { .ta__grid--2 { grid-template-columns: 1fr 1fr; } }
.ta__field { display: block; min-width: 0; margin: 0; }
.ta .ta__field--last { margin-bottom: 22px; }
.ta__field > .ta__label, .ta__label { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 500; color: var(--ta-ink); margin: 0 0 6px; text-transform: none; letter-spacing: 0; }
.ta__label small, .ta__label .ta__opt { font-size: 12px; color: var(--ta-grey) !important; font-weight: 400; }
.ta__control { position: relative; }
.ta__control > .ta-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ta-grey); pointer-events: none; }
.ta .ta__input {
  display: block; width: 100%; height: 48px; padding: 0 14px 0 44px;
  font: inherit; font-size: 15px; color: var(--ta-ink); background: #fff;
  border: 1px solid var(--ta-line); border-radius: 4px; outline: 0; appearance: none; -webkit-appearance: none;
  transition: border-color .15s, background-color .15s;
}
.ta .ta__input::placeholder { color: #9a9ca0; }
.ta .ta__input:hover { border-color: #9a9ca0; }
.ta .ta__input:focus { border-color: var(--ta-ink); outline: 2px solid var(--ta-ink); outline-offset: 1px; }
.ta .ta__input[aria-invalid="true"] { border-color: var(--ta-red); background: #fffafa; }
.ta .ta__input.has-toggle { padding-right: 48px; }
.ta select.ta__input { padding-right: 40px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235c5e62' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; }
.ta__toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: 4px; color: var(--ta-grey); cursor: pointer; padding: 0;
}
.ta__toggle:hover { color: var(--ta-ink); background: var(--ta-soft); }
.ta__toggle:focus-visible { outline: 2px solid var(--ta-ink); }
.ta__toggle .ta-icon { position: static; transform: none; }
.ta__toggle [data-hide] { display: none; }
.ta__toggle[aria-pressed="true"] [data-show] { display: none; }
.ta__toggle[aria-pressed="true"] [data-hide] { display: inline; }
.ta__error { display: flex; gap: 6px; align-items: flex-start; color: var(--ta-red) !important; font-size: 12px; line-height: 17px; margin-top: 6px; }
.ta__error .ta-icon { flex: none; margin-top: 1px; }
.ta__hint { color: var(--ta-grey) !important; font-size: 12px; line-height: 17px; margin-top: 6px; }

/* Password strength */
.ta__meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.ta__meter i { height: 4px; border-radius: 2px; background: #e5e5e5; transition: background-color .2s; }
.ta__meter[data-level="1"] i:nth-child(-n+1) { background: var(--ta-red); }
.ta__meter[data-level="2"] i:nth-child(-n+2) { background: #e8a021; }
.ta__meter[data-level="3"] i:nth-child(-n+3) { background: #7bb23a; }
.ta__meter[data-level="4"] i { background: #2f9e44; }
.ta__meter-label { font-size: 12px; color: var(--ta-grey); margin-top: 4px; min-height: 17px; }

/* Row helpers, checkbox, buttons */
.ta__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 22px; }
.ta__check { display: inline-flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 20px; color: var(--ta-ink); cursor: pointer; margin: 0; text-transform: none; letter-spacing: 0; font-weight: 400; }
.ta__check input { appearance: none; -webkit-appearance: none; flex: none; width: 20px; height: 20px; margin: 0; border: 1px solid var(--ta-line); border-radius: 4px; background: #fff; display: inline-grid; place-content: center; cursor: pointer; }
.ta__check input:checked { background: var(--ta-ink); border-color: var(--ta-ink); }
.ta__check input:checked::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.ta__check input:focus-visible { outline: 2px solid var(--ta-ink); outline-offset: 2px; }
.ta__check a { text-decoration: underline; font-weight: 500; }
.ta__link { font-size: 13px; font-weight: 500; text-decoration: underline; }
.ta a { color: var(--ta-ink); }
.ta a:hover, .ta a:focus { color: var(--ta-red) !important; }

.ta__btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 20px;
  font: inherit; font-size: 14px; font-weight: 500; border-radius: 4px; border: 1px solid transparent; cursor: pointer; text-decoration: none !important;
  transition: background-color .15s, border-color .15s, color .15s;
}
.ta__btn--primary { background: var(--ta-ink); color: #fff !important; border-color: var(--ta-ink); }
.ta__btn--primary:hover, .ta__btn--primary:focus { background: var(--ta-red); border-color: var(--ta-red); color: #fff !important; }
.ta__btn--ghost { background: #fff; color: var(--ta-ink) !important; border-color: var(--ta-line); }
.ta__btn--ghost:hover, .ta__btn--ghost:focus { background: var(--ta-soft); border-color: var(--ta-ink); color: var(--ta-ink) !important; }
.ta__btn:focus-visible { outline: 2px solid var(--ta-ink); outline-offset: 2px; }
.ta__btn[disabled] { opacity: .7; cursor: progress; }
.ta__btn .ta__spin { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: ta-spin .7s linear infinite; }
.ta__btn.is-loading .ta__spin { display: inline-block; }
.ta__btn.is-loading .ta-icon { display: none; }
@keyframes ta-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ta__btn .ta__spin { animation-duration: 2s; } }

.ta__divider { display: flex; align-items: center; gap: 12px; color: var(--ta-grey); font-size: 12px; margin: 22px 0; }
.ta__divider::before, .ta__divider::after { content: ""; flex: 1; height: 1px; background: #e5e5e5; }
.ta__switch { text-align: center; font-size: 14px; color: var(--ta-grey); margin: 24px 0 0; }
.ta__switch a { font-weight: 600; text-decoration: underline; }
.ta__assure { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; color: var(--ta-grey); margin-top: 18px; }

.ta__foot { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ta-grey); font-size: 12px; text-align: center; }
.ta__lang .tesla-lang-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; font-size: 13px; font-weight: 500; }
.ta__lang .tesla-lang-link:hover { text-decoration: underline; }

/* Compact trust strip shown instead of the brand panel on phones/tablets */
.ta__perks--inline { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 18px 0 0; padding: 0; list-style: none; }
.ta__perks--inline li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ta-grey); }
@media (min-width: 992px) { .ta__perks--inline { display: none; } }
.ta .ta__title { font-size: 26px !important; line-height: 32px !important; letter-spacing: 0; text-transform: none; }
@media (min-width: 576px) { .ta .ta__title { font-size: 30px !important; line-height: 36px !important; } }
.ta .ta__row { margin-top: 16px; }
@media (min-width: 992px) { .ta__brand { position: sticky; top: 0; height: 100vh; height: 100svh; align-self: start; } }
