body {
    min-height: 100vh;
    background: #f5f8ff;
    color: #17202a;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(58, 134, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(58, 134, 255, 0.08) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 70%);
}

.auth-shell {
    position: relative;
    width: min(1120px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 32px 0;
    display: flex;
    align-items: center;
}

.auth-card,
.auth {
    width: 100%;
    min-height: 640px;
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #dbe6f5;
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(23, 32, 42, 0.12);
}

.auth-card-compact {
    max-width: 980px;
    margin: 0 auto;
}

.auth-visual,
.auth-left {
    position: relative;
    min-height: 100%;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #eef4ff;
    border-right: 1px solid #dbe6f5;
}

.auth-visual::after,
.auth-left::after {
    content: "";
    position: absolute;
    inset: auto 24px 24px auto;
    width: 112px;
    height: 112px;
    border: 1px solid rgba(255, 122, 89, 0.45);
    border-radius: 8px;
}

.auth-brand-link {
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
}

.auth-brand-logo {
    width: 152px;
    max-width: 100%;
    height: auto;
    display: block;
}

.auth-panel-logo,
.sign-favicon {
    width: 132px;
    max-width: 100%;
    height: auto;
    display: none;
    margin-bottom: 18px;
}

.auth-illustration,
.auth-left > img {
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    margin: 16px 0;
}

.auth-visual-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
}

.auth-kicker {
    width: max-content;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #3a86ff;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.auth-title,
.auth-panel h2 {
    margin: 0;
    color: #17202a;
    font-size: clamp(1.55rem, 2.6vw, 2.1rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0;
}

.auth-visual-title {
    margin: 0;
    color: #17202a;
    font-size: clamp(1.65rem, 3vw, 2.55rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0;
}

.auth-subtitle,
.auth-visual-text {
    margin: 10px 0 0;
    color: #5f6f8a;
    line-height: 1.6;
}

.auth-visual-text {
    margin-top: 0;
    font-size: 0.98rem;
    line-height: 1.65;
}

.auth-stat-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.auth-stat {
    min-height: 72px;
    padding: 12px;
    border: 1px solid #d4e2f3;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
}

.auth-stat strong {
    display: block;
    color: #17202a;
    font-size: 1rem;
    line-height: 1.2;
}

.auth-stat span {
    display: block;
    margin-top: 4px;
    color: #5f6f8a;
    font-size: 0.76rem;
    line-height: 1.3;
}

.auth-panel,
.auth-right {
    padding: clamp(24px, 4vw, 48px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-panel-header {
    margin-bottom: 24px;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-form .form-label {
    margin-bottom: 7px;
    color: #253b5c;
    font-weight: 700;
    font-size: 0.92rem;
}

.auth-field {
    position: relative;
}

.auth-field .form-control,
.auth-form .form-control,
.auth-modal .form-control {
    min-height: 48px;
    border-color: #cfdcf0;
    border-radius: 8px;
    color: #17202a;
    box-shadow: none;
}

.auth-field .form-control:focus,
.auth-form .form-control:focus,
.auth-modal .form-control:focus {
    border-color: #3a86ff;
    box-shadow: 0 0 0 0.2rem rgba(58, 134, 255, 0.2);
}

.auth-field .form-control.is-invalid,
.auth-form .form-control.is-invalid {
    border-color: #d64550;
    background-image: none;
    box-shadow: 0 0 0 0.2rem rgba(214, 69, 80, 0.13);
}

.auth-field .form-control.is-valid-custom,
.auth-form .form-control.is-valid-custom {
    border-color: #2563eb;
    background-image: none;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.13);
}

.auth-input-with-action,
.password-wrapper,
.password-input-container {
    position: relative;
}

.auth-input-with-action .form-control,
.password-wrapper .form-control,
.password-input-container .form-control {
    padding-right: 48px;
}

.auth-password-toggle,
.toggle-password {
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    color: #5c6f68;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-password-toggle,
.toggle-password {
    position: absolute;
    right: 5px;
    bottom: 5px;
    cursor: pointer;
    z-index: 2;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus,
.toggle-password:hover,
.toggle-password:focus {
    color: #3a86ff;
}

.auth-primary-btn {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 8px;
    border-color: #3a86ff;
    background: #3a86ff;
    color: #ffffff;
    font-weight: 800;
}

.auth-primary-btn:hover,
.auth-primary-btn:focus {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.auth-secondary-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 8px;
    border-color: #cfdcf0;
    color: #253b5c;
    font-weight: 800;
}

.auth-secondary-btn:hover,
.auth-secondary-btn:focus {
    border-color: #3a86ff;
    color: #3a86ff;
}

.auth-secondary-link {
    color: #3a86ff;
    font-weight: 800;
    text-decoration: none;
}

.auth-secondary-link:hover,
.auth-secondary-link:focus {
    color: #2563eb;
    text-decoration: underline;
}

.auth-footer,
.main-signin-footer {
    margin-top: 24px;
    text-align: center;
    color: #5f6f8a;
}

.auth-footer p,
.main-signin-footer p {
    margin: 0;
}

.auth-footer-stack {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 18px;
}

.auth-version {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    margin-top: 16px;
    padding: 4px 10px;
    border: 1px solid #dbe6f5;
    border-radius: 8px;
    color: #667892;
    font-size: 0.72rem;
    font-weight: 700;
}

.auth-alert {
    border-radius: 8px;
    line-height: 1.5;
}

.auth-alert ul {
    margin-bottom: 0;
    padding-left: 1rem;
}

.auth-note {
    display: flex;
    gap: 10px;
    padding: 12px;
    border: 1px solid #dbe6f5;
    border-radius: 8px;
    background: #f8faff;
    color: #5f6f8a;
    line-height: 1.55;
}

.auth-note i {
    color: #3a86ff;
    margin-top: 2px;
}

.auth-progress {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.auth-progress-step {
    flex: 1;
    height: 6px;
    border-radius: 8px;
    background: #dbe6f5;
}

.auth-progress-step.active {
    background: #3a86ff;
}

.auth-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.auth-choice-card,
.method-card {
    min-height: 150px;
    width: 100%;
    padding: 18px;
    border: 2px solid #dbe6f5;
    border-radius: 8px;
    background: #ffffff;
    color: #17202a;
    text-align: left;
    transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.auth-choice-card:hover,
.auth-choice-card:focus,
.auth-choice-card.selected,
.auth-choice-card[aria-pressed="true"],
.method-card:hover,
.method-card:focus,
.method-card.selected,
.method-card[aria-pressed="true"] {
    border-color: #3a86ff;
    box-shadow: 0 12px 28px rgba(58, 134, 255, 0.18);
    transform: translateY(-2px);
    background: #f3f7ff;
}

.auth-choice-icon,
.method-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border-radius: 8px;
    background: #eef4ff;
    color: #3a86ff;
    font-size: 1.2rem;
}

.auth-choice-title {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 800;
}

.auth-choice-text {
    margin: 0;
    color: #5f6f8a;
    font-size: 0.88rem;
    line-height: 1.45;
}

.auth-password-meter {
    height: 6px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 8px;
    background: #e1e8f5;
}

.auth-password-meter-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #d64550;
    transition: width 180ms ease, background-color 180ms ease;
}

.auth-password-meter-bar[data-strength="2"] {
    background: #f4b860;
}

.auth-password-meter-bar[data-strength="3"] {
    background: #3a86ff;
}

.auth-password-meter-bar[data-strength="4"] {
    background: #2563eb;
}

.auth-helper-list {
    display: grid;
    gap: 6px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    color: #6c7f9c;
    font-size: 0.82rem;
}

.auth-helper-list li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-helper-list li::before {
    content: "";
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 8px;
    background: #cfdcf0;
}

.auth-helper-list li.is-valid {
    color: #2563eb;
}

.auth-helper-list li.is-valid::before {
    background: #2563eb;
}

.auth-otp-input,
.otp-input {
    width: min(180px, 100%);
    min-height: 54px;
    text-align: center;
    letter-spacing: 6px;
    font-size: 1.35rem;
    font-weight: 800;
}

.invalid-feedback.show {
    display: block;
}

.auth-success-icon {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    border-radius: 8px;
    background: #eaf2ff;
    color: #2563eb;
    font-size: 1.8rem;
}

.auth-alert.alert-success {
    border-color: #b8d1ff;
    background: #eaf2ff;
    color: #174ea6;
}

.auth-modal .modal-content,
.auth-modal-content {
    min-height: auto;
    border: 1px solid #dbe6f5;
    border-radius: 16px;
    box-shadow: 0 28px 70px rgba(23, 32, 42, 0.2);
}

.modal-content-sm {
    max-width: 420px;
    margin: 0 auto;
}

.auth-modal .modal-header {
    border-bottom-color: #dbe6f5;
}

.auth-modal-surface {
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.auth-modal-header {
    padding: 1rem 1.15rem;
}

.auth-modal-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.auth-modal-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: #eaf2ff;
    color: #2563eb;
    font-size: 0.95rem;
}

.auth-modal-title {
    margin: 0;
    color: #17202a;
    font-size: 1.02rem;
    font-weight: 800;
}

.auth-modal-subtitle {
    margin-top: 0.22rem;
    color: #5f6f8a;
    font-size: 0.84rem;
    line-height: 1.45;
}

.auth-captcha-dialog,
.auth-otp-dialog,
.auth-success-dialog {
    padding: 0 0.55rem;
}

.auth-captcha-body {
    padding-top: 0.65rem;
}

#modallogin {
    min-height: 336px;
    max-width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.95rem 1rem 1rem;
}

#captcha {
    width: 100%;
    height: auto;
    min-height: 300px;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    touch-action: none;
    user-select: none;
}

.slider-container {
    height: 42px !important;
    background: #eef4ff;
    border: 1px solid #dbe6f5;
    border-radius: 8px;
    position: relative;
    user-select: none;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.slider-text {
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    color: #4f6180;
    text-align: center;
    line-height: 42px;
}

.auth-captcha-note {
    margin-top: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: #62779a;
    font-size: 0.78rem;
    font-weight: 600;
}

.auth-otp-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border: 1px solid #cddcff;
    background: #edf3ff;
    color: #2558b8;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.auth-otp-processing {
    min-height: 214px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.2rem 0.5rem 0.7rem;
}

.auth-processing-spinner {
    width: 2.2rem;
    height: 2.2rem;
    border-width: 0.24em;
    color: #3a86ff;
}

.auth-processing-title {
    margin: 1rem 0 0.45rem;
    color: #1a2a45;
    font-size: 1.02rem;
    font-weight: 800;
}

.auth-processing-text {
    color: #647a9f;
    font-size: 0.9rem;
    line-height: 1.55;
}

.auth-register-success-body {
    padding: 2rem 1.35rem 1.5rem;
}

.auth-register-success-icon {
    width: 78px;
    height: 78px;
    margin: 0 auto 0.95rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #e8f2ff 0%, #dbe9ff 100%);
    color: #2563eb;
    font-size: 2rem;
}

.auth-register-success-title {
    margin: 0;
    color: #17202a;
    font-size: 1.28rem;
    font-weight: 800;
}

.auth-register-success-text {
    margin: 0.7rem 0 1.2rem;
    color: #5f6f8a;
    line-height: 1.6;
}

.tracking-result-list {
    display: grid;
    gap: 12px;
}

.tracking-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eaf0f8;
}

.tracking-row strong {
    color: #556987;
    font-size: 0.88rem;
}

.tracking-row span {
    color: #17202a;
    font-weight: 700;
}

.tracking-timeline {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.tracking-timeline-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #dbe6f5;
    border-radius: 8px;
    background: #f8faff;
}

.tracking-timeline-item strong {
    color: #17202a;
    font-size: 0.9rem;
}

.tracking-timeline-item span {
    color: #5f6f8a;
    font-size: 0.82rem;
}

#modalRateLimit .modal-dialog {
    max-width: 460px;
}

#modalRateLimit .modal-content {
    border: 1px solid #f2d4bf;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.18);
}

#modalRateLimit .modal-header {
    border-bottom: 0;
    padding: 1.4rem 1.4rem 0;
}

#modalRateLimit .modal-body {
    padding: 0 1.4rem 1.4rem;
}

.rate-limit-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    background: #fff4ec;
    color: #c2410c;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.rate-limit-badge-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ff7a59;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
}

.rate-limit-title {
    margin: 1rem 0 0.55rem;
    color: #17202a;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.3;
}

.rate-limit-message,
.rate-limit-detail {
    margin: 0;
    color: #5c6f68;
    line-height: 1.7;
}

.rate-limit-timer-box {
    margin: 1.25rem 0 1rem;
    padding: 1rem 1.1rem;
    border-radius: 8px;
    background: #fffaf7;
    border: 1px solid #f2d4bf;
}

.rate-limit-timer-label {
    display: block;
    color: #9a3412;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.rate-limit-timer-value {
    display: block;
    margin-top: 0.35rem;
    color: #17202a;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.rate-limit-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.rate-limit-actions .btn {
    flex: 1 1 0;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    font-weight: 800;
}

.rate-limit-actions .btn.disabled,
.rate-limit-actions .btn:disabled {
    opacity: 1;
    background: #d1d5db;
    border-color: #d1d5db;
    color: #6b7280;
}

[data-theme-mode="dark"] body {
    background: #070f1f;
    color: #dbe7ff;
}

[data-theme-mode="dark"] body::before {
    background-image:
        linear-gradient(rgba(58, 134, 255, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(58, 134, 255, 0.12) 1px, transparent 1px);
}

[data-theme-mode="dark"] .auth-card,
[data-theme-mode="dark"] .auth {
    background: #0f1c32;
    border-color: #284165;
    box-shadow: 0 26px 70px rgba(3, 10, 25, 0.62);
}

[data-theme-mode="dark"] .auth-visual,
[data-theme-mode="dark"] .auth-left {
    background: #10223d;
    border-right-color: #284165;
}

[data-theme-mode="dark"] .auth-visual::after,
[data-theme-mode="dark"] .auth-left::after {
    border-color: rgba(138, 180, 255, 0.45);
}

[data-theme-mode="dark"] .auth-panel,
[data-theme-mode="dark"] .auth-right {
    background: #0d192d;
}

[data-theme-mode="dark"] .auth-title,
[data-theme-mode="dark"] .auth-panel h2,
[data-theme-mode="dark"] .auth-visual-title,
[data-theme-mode="dark"] .auth-stat strong,
[data-theme-mode="dark"] .auth-modal-title,
[data-theme-mode="dark"] .tracking-row span,
[data-theme-mode="dark"] .tracking-timeline-item strong,
[data-theme-mode="dark"] .rate-limit-title,
[data-theme-mode="dark"] .rate-limit-timer-value {
    color: #e7efff;
}

[data-theme-mode="dark"] .auth-kicker,
[data-theme-mode="dark"] .auth-secondary-link,
[data-theme-mode="dark"] .auth-note i,
[data-theme-mode="dark"] .auth-progress-step.active {
    color: #8ab4ff;
}

[data-theme-mode="dark"] .auth-subtitle,
[data-theme-mode="dark"] .auth-visual-text,
[data-theme-mode="dark"] .auth-stat span,
[data-theme-mode="dark"] .auth-footer,
[data-theme-mode="dark"] .main-signin-footer,
[data-theme-mode="dark"] .auth-choice-text,
[data-theme-mode="dark"] .auth-helper-list,
[data-theme-mode="dark"] .tracking-row strong,
[data-theme-mode="dark"] .tracking-timeline-item span,
[data-theme-mode="dark"] .rate-limit-message,
[data-theme-mode="dark"] .rate-limit-detail,
[data-theme-mode="dark"] .slider-text {
    color: #a1b5d4;
}

[data-theme-mode="dark"] .auth-form .form-label,
[data-theme-mode="dark"] .auth-footer-stack span,
[data-theme-mode="dark"] .auth-version {
    color: #c6d7ef;
}

[data-theme-mode="dark"] .auth-stat,
[data-theme-mode="dark"] .auth-note,
[data-theme-mode="dark"] .tracking-timeline-item {
    background: #142744;
    border-color: #2f486e;
}

[data-theme-mode="dark"] .auth-version {
    border-color: #2f486e;
    background: #142744;
}

[data-theme-mode="dark"] .auth-field .form-control,
[data-theme-mode="dark"] .auth-form .form-control,
[data-theme-mode="dark"] .auth-modal .form-control,
[data-theme-mode="dark"] .slider-container {
    background: #0e1d34;
    border-color: #2e476f;
    color: #e7efff;
}

[data-theme-mode="dark"] .auth-field .form-control::placeholder,
[data-theme-mode="dark"] .auth-form .form-control::placeholder {
    color: #8098bb;
}

[data-theme-mode="dark"] .auth-field .form-control:focus,
[data-theme-mode="dark"] .auth-form .form-control:focus,
[data-theme-mode="dark"] .auth-modal .form-control:focus {
    border-color: #7fb0ff;
    box-shadow: 0 0 0 0.22rem rgba(127, 176, 255, 0.22);
}

[data-theme-mode="dark"] .auth-password-toggle,
[data-theme-mode="dark"] .toggle-password {
    color: #9db3d2;
}

[data-theme-mode="dark"] .auth-secondary-btn {
    border-color: #2e476f;
    color: #d7e5fb;
    background: #11233e;
}

[data-theme-mode="dark"] .auth-secondary-btn:hover,
[data-theme-mode="dark"] .auth-secondary-btn:focus,
[data-theme-mode="dark"] .auth-secondary-link:hover,
[data-theme-mode="dark"] .auth-secondary-link:focus {
    border-color: #8ab4ff;
    color: #b7d3ff;
}

[data-theme-mode="dark"] .auth-progress-step,
[data-theme-mode="dark"] .auth-helper-list li::before {
    background: #2f486e;
}

[data-theme-mode="dark"] .auth-choice-card,
[data-theme-mode="dark"] .method-card {
    background: #11233e;
    border-color: #2f486e;
    color: #d7e5fb;
}

[data-theme-mode="dark"] .auth-choice-card:hover,
[data-theme-mode="dark"] .auth-choice-card:focus,
[data-theme-mode="dark"] .auth-choice-card.selected,
[data-theme-mode="dark"] .auth-choice-card[aria-pressed="true"],
[data-theme-mode="dark"] .method-card:hover,
[data-theme-mode="dark"] .method-card:focus,
[data-theme-mode="dark"] .method-card.selected,
[data-theme-mode="dark"] .method-card[aria-pressed="true"] {
    background: #17305a;
    border-color: #8ab4ff;
    box-shadow: 0 14px 30px rgba(8, 20, 44, 0.45);
}

[data-theme-mode="dark"] .auth-choice-icon,
[data-theme-mode="dark"] .method-icon,
[data-theme-mode="dark"] .auth-success-icon {
    background: rgba(58, 134, 255, 0.2);
    color: #9dc2ff;
}

[data-theme-mode="dark"] .auth-modal .modal-content,
[data-theme-mode="dark"] .auth-modal-content {
    background: #10223d;
    border-color: #2f486e;
}

[data-theme-mode="dark"] .auth-modal-surface {
    background: linear-gradient(180deg, #10223d 0%, #0e1d34 100%);
}

[data-theme-mode="dark"] .auth-modal .modal-header {
    border-bottom-color: #2f486e;
}

[data-theme-mode="dark"] .auth-modal-icon {
    background: rgba(138, 180, 255, 0.18);
    color: #bcd7ff;
}

[data-theme-mode="dark"] .auth-modal-subtitle,
[data-theme-mode="dark"] .auth-captcha-note,
[data-theme-mode="dark"] .auth-processing-text,
[data-theme-mode="dark"] .auth-register-success-text {
    color: #9fb5d6;
}

[data-theme-mode="dark"] .auth-otp-badge {
    border-color: rgba(138, 180, 255, 0.35);
    background: rgba(138, 180, 255, 0.12);
    color: #bfd8ff;
}

[data-theme-mode="dark"] .auth-processing-title,
[data-theme-mode="dark"] .auth-register-success-title {
    color: #e3edff;
}

[data-theme-mode="dark"] .auth-register-success-icon {
    background: linear-gradient(145deg, rgba(138, 180, 255, 0.22) 0%, rgba(96, 165, 250, 0.18) 100%);
    color: #c7ddff;
}

[data-theme-mode="dark"] .auth-alert {
    background: #10223d;
    border: 1px solid #2f486e;
    color: #d4e3fb;
}

[data-theme-mode="dark"] .auth-alert.alert-success {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(123, 170, 255, 0.45);
    color: #c9deff;
}

[data-theme-mode="dark"] .auth-alert.alert-danger {
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(248, 113, 113, 0.45);
    color: #fecaca;
}

[data-theme-mode="dark"] #modalRateLimit .modal-content {
    background: #10223d;
    border-color: #2f486e;
    box-shadow: 0 28px 80px rgba(2, 6, 23, 0.52);
}

[data-theme-mode="dark"] .rate-limit-badge {
    background: rgba(249, 115, 22, 0.16);
    color: #fdba74;
}

[data-theme-mode="dark"] .rate-limit-timer-box {
    background: #132a4b;
    border-color: #2f486e;
}

[data-theme-mode="dark"] .rate-limit-timer-label {
    color: #fdba74;
}

[data-theme-mode="dark"] .slider-container {
    background: #152b4a;
    border-color: #2f486e;
}

@media (max-width: 920px) {
    .auth-shell {
        align-items: flex-start;
        padding: 20px 0;
    }

    .auth-card,
    .auth {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .auth-visual,
    .auth-left {
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid #dbe6f5;
    }

    .auth-illustration,
    .auth-left > img {
        display: none;
    }

    .auth-stat-row,
    .auth-visual::after,
    .auth-left::after {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .auth-shell {
        width: min(100% - 14px, 1120px);
        padding: 10px 0;
    }

    .auth-visual,
    .auth-left {
        display: none;
    }

    .auth-panel-logo,
    .sign-favicon {
        display: block;
        margin: 0 auto 14px;
    }

    .auth-card,
    .auth {
        border-radius: 14px;
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .auth-panel,
    .auth-right,
    .auth-visual,
    .auth-left {
        padding: 18px;
    }

    .auth-title,
    .auth-panel h2 {
        font-size: clamp(1.35rem, 5.7vw, 1.7rem);
    }

    .auth-subtitle,
    .auth-visual-text {
        font-size: 0.88rem;
        line-height: 1.55;
    }

    .auth-form {
        gap: 13px;
    }

    .auth-form .row.g-3 {
        --bs-gutter-y: 0.7rem;
        --bs-gutter-x: 0.7rem;
    }

    .auth-form .form-label {
        font-size: 0.86rem;
        margin-bottom: 6px;
    }

    .auth-field .form-control,
    .auth-form .form-control,
    .auth-modal .form-control,
    .auth-primary-btn {
        min-height: 46px;
    }

    .auth-password-toggle,
    .toggle-password {
        width: 34px;
        height: 34px;
        right: 4px;
        bottom: 6px;
    }

    .auth-footer {
        margin-top: 16px;
    }

    .auth-footer-stack {
        gap: 7px 12px;
        font-size: 0.84rem;
    }

    .auth-version {
        font-size: 0.68rem;
    }

    .auth-modal-header {
        padding: 0.9rem 0.9rem;
    }

    .auth-modal-heading {
        gap: 0.6rem;
    }

    .auth-modal-title {
        font-size: 0.98rem;
    }

    .auth-modal-subtitle {
        font-size: 0.79rem;
    }

    .auth-modal-icon {
        width: 30px;
        height: 30px;
        border-radius: 9px;
        font-size: 0.88rem;
    }

    #modallogin {
        min-height: 316px;
        padding: 0.8rem;
    }

    #captcha {
        height: auto;
        min-height: 290px;
    }

    .auth-otp-input,
    .otp-input {
        width: min(158px, 100%);
        min-height: 50px;
        font-size: 1.2rem;
        letter-spacing: 5px;
    }

    .auth-register-success-body {
        padding: 1.65rem 1rem 1.2rem;
    }

    .auth-register-success-icon {
        width: 66px;
        height: 66px;
        border-radius: 16px;
        font-size: 1.7rem;
    }

    .auth-register-success-title {
        font-size: 1.12rem;
    }

    .auth-register-success-text {
        font-size: 0.88rem;
        margin-top: 0.55rem;
    }
}

@media (max-width: 576px) {
    .auth-shell {
        width: min(100% - 18px, 1120px);
        padding: 9px 0;
    }

    .auth-visual,
    .auth-left,
    .auth-panel,
    .auth-right {
        padding: 22px;
    }

    .auth-stat-row,
    .auth-choice-grid {
        grid-template-columns: 1fr;
    }

    .tracking-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .tracking-timeline-item,
    .rate-limit-actions {
        flex-direction: column;
    }

    .rate-limit-title {
        font-size: 1.25rem;
    }

    .rate-limit-timer-value {
        font-size: 1.7rem;
    }
}
