:root {
    --auth-bg: #202020;
    --auth-bg-card: #2a2a2a;
    --auth-bg-input: #1a1a1a;
    --auth-border: rgba(212, 175, 55, 0.18);
    --auth-border-focus: rgba(212, 175, 55, 0.55);
    --auth-gold: #d4af37;
    --auth-gold-light: #e8c96a;
    --auth-gold-dark: #a67c00;
    --auth-text: #f0f0f0;
    --auth-text-muted: #9a9a9a;
    --auth-radius: 16px;
}

html, body,
html.auth-theme,
html.auth-theme body,
html.deeppurple-theme.auth-theme,
html.deeppurple-theme.auth-theme body {
    background: #202020 !important;
    background-color: #202020 !important;
    color: var(--auth-text);
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.auth-page {
    min-height: 100vh;
    background: #202020 !important;
    background-color: #202020 !important;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 20px 48px;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-logo-wrap {
    text-align: center;
    margin-bottom: 36px;
}

.auth-logo {
    max-width: 200px;
    width: 65%;
    height: auto;
    display: inline-block;
}

.auth-logo-divider {
    width: 48px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--auth-gold), transparent);
    margin: 20px auto 0;
    border-radius: 2px;
}

.auth-card {
    background: var(--auth-bg-card);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    padding: 32px 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.auth-card-header {
    text-align: center;
    margin-bottom: 28px;
    min-height: 58px;
}

.auth-title {
    font-size: 22px;
    font-weight: 500;
    color: var(--auth-text);
    margin: 0 0 8px;
    letter-spacing: 0.5px;
}

.auth-subtitle {
    font-size: 13px;
    color: var(--auth-text-muted);
    margin: 0;
    letter-spacing: 0.3px;
}

.auth-subtitle--placeholder {
    visibility: hidden;
}

.auth-field {
    margin-bottom: 16px;
}

.auth-input-group {
    display: flex;
    align-items: center;
    background: var(--auth-bg-input);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow: hidden;
    height: 48px;
    min-height: 48px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.auth-input-group:focus-within {
    border-color: var(--auth-border-focus);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.auth-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    flex-shrink: 0;
    opacity: 0.95;
}

.auth-input-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}

.auth-input-toggle img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
    opacity: 0.75;
    transition: opacity 0.2s ease;
}

.auth-input-toggle:hover img {
    opacity: 1;
}

.auth-input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    color: var(--auth-text) !important;
    font-size: 15px !important;
    padding: 0 16px 0 0 !important;
    height: 48px !important;
    min-height: 48px !important;
    line-height: 48px !important;
    box-shadow: none !important;
    outline: none !important;
}

.auth-page .auth-input.form-control,
.auth-page .auth-input.form-control-lg {
    height: 48px !important;
    min-height: 48px !important;
    font-size: 15px !important;
    padding: 0 16px 0 0 !important;
    line-height: 48px !important;
    border-radius: 0 !important;
}

.auth-input::placeholder {
    color: var(--auth-text-muted) !important;
}

.auth-input-toggle {
    background: transparent !important;
    border: none !important;
    color: var(--auth-text-muted) !important;
    padding: 0 16px !important;
    cursor: pointer;
    outline: none !important;
    box-shadow: none !important;
}

.auth-input-toggle:hover {
    color: var(--auth-gold) !important;
}

.auth-btn-primary {
    display: block;
    width: 100%;
    padding: 15px 24px;
    margin-top: 8px;
    border: 1px solid var(--auth-gold-dark);
    border-radius: 12px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    color: var(--auth-gold-light) !important;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(212, 175, 55, 0.15);
    text-align: center;
    text-decoration: none !important;
}

.auth-btn-primary:hover,
.auth-btn-primary:focus {
    background: linear-gradient(135deg, #252525 0%, #3a3a3a 50%, #252525 100%);
    border-color: var(--auth-gold);
    color: #fff !important;
    box-shadow: 0 6px 24px rgba(212, 175, 55, 0.15), inset 0 1px 0 rgba(212, 175, 55, 0.25);
    transform: translateY(-1px);
}

.auth-btn-primary:active {
    transform: translateY(0);
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
}

.auth-link {
    color: var(--auth-gold) !important;
    font-size: 14px;
    text-decoration: none !important;
    letter-spacing: 0.3px;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: var(--auth-gold-light) !important;
}

.auth-link-muted {
    color: var(--auth-text-muted) !important;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.auth-link-muted:hover {
    color: var(--auth-gold) !important;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--auth-text-muted);
    font-size: 12px;
    letter-spacing: 0.5px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
}

.auth-divider span {
    padding: 0 16px;
}

.auth-page--register {
    position: relative;
    background: #202020 !important;
}

.auth-back-top {
    position: fixed;
    top: 16px;
    left: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--auth-bg-card);
    border: 1px solid var(--auth-border);
    color: var(--auth-gold) !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.auth-back-top:hover {
    border-color: var(--auth-gold);
    background: rgba(212, 175, 55, 0.08);
}

.auth-topbar {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 4px;
}

.auth-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--auth-bg-card);
    border: 1px solid var(--auth-border);
    color: var(--auth-gold) !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.auth-back:hover {
    border-color: var(--auth-gold);
    background: rgba(212, 175, 55, 0.08);
}

.auth-topbar-title {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: var(--auth-text);
    letter-spacing: 0.5px;
    margin-right: 40px;
}

.auth-page .iti--allow-dropdown {
    width: 100%;
}

.auth-page .iti__selected-flag,
.auth-page .iti__country-list {
    background-color: var(--auth-bg-input);
    color: var(--auth-text);
}

.auth-page .iti__country.iti__highlight {
    background-color: rgba(212, 175, 55, 0.15);
}

.auth-page .iti__tel-input {
    background: transparent !important;
    color: var(--auth-text) !important;
    border: none !important;
}

.auth-page .bg-default,
.auth-page .pd1,
.auth-page .wrapper.passport {
    background: transparent !important;
    padding: 0 !important;
}

.auth-page .form-control {
    background: transparent !important;
    border: none !important;
}

.auth-page .input-group-text {
    background: transparent !important;
    border: none !important;
}

.auth-page .btn-default {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* 覆盖 red/style.css 中 deeppurple-theme 白色背景 */
html.auth-theme.deeppurple-theme .wrapper,
html.auth-theme.deeppurple-theme body,
html.auth-theme.deeppurple-theme .bg-template,
html.auth-theme.deeppurple-theme .bg-default,
html.auth-theme.deeppurple-theme .loader-screen {
    background: #202020 !important;
    background-color: #202020 !important;
}
