.auth-theme-control {
    display: flex;
    justify-content: flex-end;
    width: min(420px, 100%);
    margin-bottom: 12px;
}

/* Authentication pages and dialogs */
html[data-theme="dark"] .auth-layout {
    background-color: var(--theme-bg);
    color: var(--theme-text);
}

html[data-theme="dark"] .auth-page-container {
    background: var(--theme-bg);
}

html[data-theme="dark"] :is(.auth-card, .cm-modal, .auth-page-container .cm-modal) {
    background: var(--theme-surface);
    color: var(--theme-text);
    box-shadow: var(--theme-shadow), 0 0 0 1px var(--theme-border);
}

html[data-theme="dark"] :is(.auth-card h1, .cm-title, .auth-page-container .form-label) {
    color: var(--theme-text);
}

html[data-theme="dark"] :is(
    .auth-card .auth-subtitle, .auth-field label, .auth-extras label, .auth-back,
    .auth-footer-text, .auth-copyright, .auth-divider, .cm-modal p, .social-divider
) {
    color: var(--theme-muted);
}

html[data-theme="dark"] :is(.auth-divider, .social-divider)::before,
html[data-theme="dark"] :is(.auth-divider, .social-divider)::after {
    background: var(--theme-border);
}

html[data-theme="dark"] :is(.auth-field input, .cm-input, .auth-google-btn, .cm-modal .social-btn--google) {
    background: var(--theme-raised);
    border-color: var(--theme-border);
    color: var(--theme-text);
}

html[data-theme="dark"] :is(.auth-field input, .cm-input)::placeholder {
    color: var(--theme-muted);
}

html[data-theme="dark"] :is(.auth-field input, .cm-input):focus {
    background: var(--theme-raised);
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 3px var(--theme-accent-surface);
}

html[data-theme="dark"] .auth-field .auth-phone-field input {
    background: transparent;
    box-shadow: none;
}

html[data-theme="dark"] :is(.auth-field input.is-invalid, .cm-input.is-invalid) {
    border-color: var(--theme-danger);
}

html[data-theme="dark"] :is(.auth-field .field-error, .auth-card .field-error, .cm-error) {
    color: var(--theme-danger);
}

html[data-theme="dark"] :is(.auth-extras a, .auth-back:hover, .auth-footer-text a, .cm-link) {
    color: var(--theme-accent);
}

html[data-theme="dark"] :is(.auth-google-btn, .cm-modal .social-btn--google):hover {
    background: var(--theme-hover);
    border-color: var(--theme-accent);
    color: var(--theme-text);
}

html[data-theme="dark"] .cm-close {
    background: var(--theme-raised);
    color: var(--theme-muted);
}

html[data-theme="dark"] .cm-close:hover {
    background: var(--theme-danger-surface);
    color: var(--theme-danger);
}

html[data-theme="dark"] :is(.auth-btn, .cm-submit, .profile-content-area .btn-primary, .status-card .continue-shopping-btn) {
    background: var(--theme-accent);
    color: var(--theme-bg);
}

html[data-theme="dark"] :is(.auth-btn, .cm-submit, .profile-content-area .btn-primary, .status-card .continue-shopping-btn):hover {
    background: #ffc496;
    color: var(--theme-bg);
}

/* Checkout and payment status */
html[data-theme="dark"] :is(.checkout-heading, .checkout-form, .status-card, .fail-card) {
    --brand-color: var(--theme-accent);
    --border-color: var(--theme-border);
    --text-color: var(--theme-muted);
    --text-dark: var(--theme-text);
    color: var(--theme-text);
}

html[data-theme="dark"] :is(.checkout-heading, .checkout-form .summary-box, .checkout-form .customer-details) {
    background: var(--theme-surface);
    box-shadow: var(--theme-shadow);
}

html[data-theme="dark"] .checkout-form :is(.promo-section, .delivery-notice) {
    border-color: var(--theme-border);
}

html[data-theme="dark"] .checkout-form .delivery-notice {
    background: var(--theme-raised);
    border-left-color: var(--theme-accent);
}

html[data-theme="dark"] .checkout-form :is(
    .form-group input:is([type="text"], [type="tel"], [type="email"]),
    .form-group textarea, .form-group select, .promo-input, .location-type-btn, .promo-btn
) {
    background: var(--theme-raised);
    border-color: var(--theme-border);
    color: var(--theme-text);
}

html[data-theme="dark"] .checkout-form :is(.form-group input, .form-group textarea, .promo-input)::placeholder {
    color: var(--theme-muted);
}

html[data-theme="dark"] .checkout-form :is(.form-group input, .form-group select, .form-group textarea, .promo-input):focus {
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 3px var(--theme-accent-surface);
}

html[data-theme="dark"] .checkout-form .promo-btn:hover:not(:disabled) {
    background: var(--theme-hover);
}

html[data-theme="dark"] .checkout-form .location-type-btn strong {
    color: var(--theme-text);
}

html[data-theme="dark"] .checkout-form .location-type-btn :is(i, small) {
    color: var(--theme-muted);
}

html[data-theme="dark"] .checkout-form .location-type-btn:is(:hover, .is-active) {
    background: var(--theme-accent-surface);
    border-color: var(--theme-accent);
    box-shadow: none;
}

html[data-theme="dark"] .checkout-form .location-type-btn:is(:hover, .is-active) i {
    color: var(--theme-accent);
}

html[data-theme="dark"] :is(.checkout-form .location-type-hint, .checkout-offline) {
    background: var(--theme-warning-surface);
    border-color: var(--theme-warning);
    color: var(--theme-warning);
}

html[data-theme="dark"] .checkout-form .location-type-hint i {
    color: inherit;
}

html[data-theme="dark"] .checkout-form .choices__inner {
    background: var(--theme-raised) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text);
}

html[data-theme="dark"] .checkout-form :is(.is-focused, .is-open) .choices__inner {
    border-color: var(--theme-accent) !important;
    box-shadow: 0 0 0 3px var(--theme-accent-surface);
}

html[data-theme="dark"] .checkout-form .choices :is(.choices__list--dropdown, .choices__input--cloned) {
    background: var(--theme-raised);
    border-color: var(--theme-border);
    color: var(--theme-text);
}

html[data-theme="dark"] .checkout-form .choices__list--dropdown .choices__item--selectable.is-highlighted {
    background: var(--theme-hover);
    color: var(--theme-text);
}

html[data-theme="dark"] .checkout-form .choices[data-type*="select-one"]::after {
    border-top-color: var(--theme-muted);
}

html[data-theme="dark"] .checkout-form .choices[data-type*="select-one"].is-open::after {
    border-top-color: transparent;
    border-bottom-color: var(--theme-muted);
}

html[data-theme="dark"] .checkout-form :is(.is-invalid, .choices.is-invalid .choices__inner) {
    border-color: var(--theme-danger) !important;
}

html[data-theme="dark"] .checkout-form :is(.invalid-feedback, .text-danger) {
    color: var(--theme-danger) !important;
}

html[data-theme="dark"] .checkout-form :is(.discount-row span, .text-success) {
    color: var(--theme-success) !important;
}

html[data-theme="dark"] .checkout-error {
    background: var(--theme-danger-surface);
    border-color: var(--theme-danger);
    color: var(--theme-danger);
}

html[data-theme="dark"] .checkout-form .checkout-payment-brands img {
    box-sizing: content-box;
    background: #fff;
    border-radius: 5px;
    padding: 2px 5px;
}

html[data-theme="dark"] .checkout-form .place-order:not(:disabled),
html[data-theme="dark"] .fail-card .place-order {
    background: var(--theme-success);
    color: var(--theme-bg);
}

html[data-theme="dark"] .checkout-form .place-order:not(:disabled):hover,
html[data-theme="dark"] .fail-card .place-order:hover {
    background: #a3e9c1;
    color: var(--theme-bg);
}

html[data-theme="dark"] .checkout-form :is(.place-order, .promo-btn):disabled {
    background: var(--theme-raised);
    color: var(--theme-muted);
}

/* Account pages, orders and wishlist */
html[data-theme="dark"] .profile-wrapper {
    --primary-color: var(--theme-text);
    --accent-color: var(--theme-accent);
    --text-light: var(--theme-muted);
    --border-color: var(--theme-border);
    color: var(--theme-text);
}

html[data-theme="dark"] .profile-wrapper .profile-content-area {
    background: var(--theme-surface);
    box-shadow: var(--theme-shadow);
}

html[data-theme="dark"] .profile-wrapper :is(.profile-header-title, .detail-title, .opm-card, .opm-img, .profile-table td) {
    border-color: var(--theme-border);
}

html[data-theme="dark"] .profile-wrapper :is(.dashboard-welcome, .stat-box, .order-header-bar, .detail-box, .order-card-mobile, .order-products-mobile, .wishlist-item) {
    background: var(--theme-raised);
}

html[data-theme="dark"] .profile-wrapper .dw-icon {
    background: var(--theme-accent-surface);
    border-color: var(--theme-border);
    color: var(--theme-accent);
}

html[data-theme="dark"] .profile-wrapper .dashboard-welcome h4 {
    color: var(--theme-text);
}

html[data-theme="dark"] .profile-wrapper .wishlist-item__name {
    color: var(--theme-text);
}

html[data-theme="dark"] .profile-wrapper .wishlist-item__name:hover {
    color: var(--theme-accent);
}

html[data-theme="dark"] :is(
    .profile-wrapper .stat-label, .profile-wrapper .stat-number small, .profile-wrapper .info-label,
    .profile-wrapper .ocm-date, .profile-wrapper .dashboard-welcome p, .profile-wrapper .opm-meta span,
    .profile-wrapper .wishlist-item__price, .profile-wrapper .wishlist-item__price .old-price
) {
    color: var(--theme-muted);
}

html[data-theme="dark"] :is(.profile-wrapper .stat-box.info .stat-icon, .profile-wrapper .status-processing, .profile-wrapper .status-shipped, .profile-wrapper .alert-info) {
    background: var(--theme-info-surface);
    color: var(--theme-info);
    border-color: var(--theme-info-surface);
}

html[data-theme="dark"] :is(.profile-wrapper .stat-box.success .stat-icon, .profile-wrapper .status-completed, .profile-wrapper .alert-success) {
    background: var(--theme-success-surface);
    color: var(--theme-success);
    border-color: var(--theme-success-surface);
}

html[data-theme="dark"] .profile-wrapper :is(.status-cancelled, .alert-danger, .form-control.is-invalid) {
    background: var(--theme-danger-surface);
    color: var(--theme-danger);
    border-color: var(--theme-danger);
}

html[data-theme="dark"] .profile-wrapper :is(.status-pending, .alert-warning) {
    background: var(--theme-warning-surface);
    color: var(--theme-warning);
    border-color: var(--theme-warning-surface);
}

html[data-theme="dark"] .profile-wrapper .status-secondary {
    background: var(--theme-hover);
    color: var(--theme-muted);
    border-color: var(--theme-border);
}

html[data-theme="dark"] .profile-wrapper .invalid-feedback {
    color: var(--theme-danger);
}

html[data-theme="dark"] .profile-wrapper :is(.form-control, .wishlist-item__img-link, .opm-img--placeholder, .wishlist-remove-btn, .profile-table th, .btn-small, .btn-back, .ocm-link) {
    background: var(--theme-raised);
    border-color: var(--theme-border);
    color: var(--theme-text);
}

html[data-theme="dark"] .profile-wrapper .form-control::placeholder {
    color: var(--theme-muted);
}

html[data-theme="dark"] .profile-wrapper .form-control:focus {
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 3px var(--theme-accent-surface);
}

html[data-theme="dark"] .profile-wrapper .form-control.is-invalid {
    border-color: var(--theme-danger);
}

html[data-theme="dark"] .profile-wrapper :is(.profile-table tbody tr:hover, .btn-small:hover, .btn-back:hover, .ocm-link:hover) {
    background: var(--theme-hover);
    color: var(--theme-text);
}

html[data-theme="dark"] .profile-wrapper .wishlist-remove-btn:hover {
    background: var(--theme-danger-surface);
    border-color: var(--theme-danger);
    color: var(--theme-danger);
}

html[data-theme="dark"] .profile-wrapper .page-item :is(.page-link, span, a) {
    background: var(--theme-raised);
    color: var(--theme-text);
    border-color: var(--theme-border);
}

html[data-theme="dark"] .profile-wrapper .page-item:not(.disabled) a:hover {
    color: var(--theme-accent);
    border-color: var(--theme-accent);
}

html[data-theme="dark"] .profile-wrapper .page-item.active span {
    background: var(--theme-accent);
    border-color: var(--theme-accent);
    color: var(--theme-bg);
}

html[data-theme="dark"] .profile-wrapper .page-item.disabled span {
    color: var(--theme-muted);
    opacity: .65;
}

.profile-verification-code {
    width: 96px;
    padding: 9px 12px;
    border: 1px solid var(--theme-border, #e0e0e0);
    border-radius: 9px;
    background: var(--theme-surface, transparent);
    font: 700 1.2rem monospace;
    letter-spacing: 6px;
    text-align: center;
    transition: border-color .2s;
}

.profile-verification-code:focus {
    border-color: var(--accent-color);
    outline: 2px solid transparent;
    box-shadow: 0 0 0 3px var(--theme-accent-surface, rgba(230, 126, 34, .12));
}
