* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root[data-theme="light"] {
    --auth-bg: #f8f9fa;
    --auth-box-bg: #ffffff;
    --auth-text: #000000;
    --auth-border: #e5e5e5;
    --auth-input-bg: #ffffff;
}

:root[data-theme="dark"] {
    --auth-bg: #1a1a1a;
    --auth-box-bg: #2d2d2d;
    --auth-text: #ffffff;
    --auth-border: #404040;
    --auth-input-bg: #252525;
}

body {
    font-family: 'Monster Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--auth-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background 0.3s;
}

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

.auth-box {
    background: var(--auth-box-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--auth-border);
    transition: all 0.3s;
}

:root[data-theme="dark"] .auth-box {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.384);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    height: 50px;
    width: auto;
    margin-bottom: 15px;
    transition: opacity 0.3s;
}

:root[data-theme="light"] .auth-logo-light {
    display: block !important;
}

:root[data-theme="light"] .auth-logo-dark {
    display: none !important;
}

:root[data-theme="dark"] .auth-logo-light {
    display: none !important;
}

:root[data-theme="dark"] .auth-logo-dark {
    display: block !important;
}

.auth-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--auth-text);
    margin: 0;
    transition: color 0.3s;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--auth-text);
    text-align: center;
    transition: color 0.3s;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--auth-text);
    font-size: 14px;
    transition: color 0.3s;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--auth-border);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s;
    background: var(--auth-input-bg);
    color: var(--auth-text);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3390ec;
    box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--auth-text);
    opacity: 0.6;
    transition: color 0.3s;
}

.error-message {
    color: #d32f2f;
    font-size: 14px;
    margin-bottom: 15px;
    padding: 10px;
    background: #ffebee;
    border-radius: 6px;
    display: none;
}

.error-message.show {
    display: block;
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: #3390ec;
    color: white;
}

.btn-primary:hover {
    background: #2481cc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(51, 144, 236, 0.3);
}

.btn-secondary {
    background: transparent;
    color: #3390ec;
    border: 2px solid #3390ec;
}

.btn-secondary:hover {
    background: #3390ec;
    color: white;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--auth-text);
    opacity: 0.6;
    transition: color 0.3s;
}

.auth-switch a {
    color: #3390ec;
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.seed-info {
    text-align: center;
    color: var(--auth-text);
    opacity: 0.7;
    margin-bottom: 20px;
    font-size: 14px;
    transition: color 0.3s;
}

.seed-options {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.seed-option {
    flex: 1;
    padding: 15px;
    border: 2px solid var(--auth-border);
    border-radius: 8px;
    background: var(--auth-input-bg);
    color: var(--auth-text);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s;
    font-family: inherit;
}

.seed-option:hover {
    border-color: #3390ec;
    background: var(--auth-box-bg);
}

.seed-option.active {
    border-color: #3390ec;
    background: #3390ec;
    color: white;
}

.seed-display {
    margin-top: 25px;
}

.seed-phrase {
    background: var(--auth-input-bg);
    border: 2px solid var(--auth-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    transition: background-color 0.3s, border-color 0.3s;
}

#seedWords {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    font-size: 14px;
    line-height: 1.8;
}

.seed-word {
    background: var(--auth-box-bg);
    color: var(--auth-text);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--auth-border);
    text-align: center;
    font-weight: 500;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

.seed-actions {
    display: flex;
    gap: 10px;
}

.seed-confirm {
    margin-top: 25px;
}

.seed-confirm h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--auth-text);
    transition: color 0.3s;
}

.seed-confirm p {
    color: var(--auth-text);
    opacity: 0.7;
    font-size: 14px;
    margin-bottom: 15px;
    transition: color 0.3s;
}

.seed-confirm textarea {
    width: 100%;
    margin-bottom: 15px;
    resize: vertical;
    background: var(--auth-input-bg);
    color: var(--auth-text);
    border: 2px solid var(--auth-border);
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

.seed-confirm h3 {
    color: var(--auth-text);
    transition: color 0.3s;
}

.seed-confirm p {
    color: var(--auth-text);
    opacity: 0.7;
    transition: color 0.3s;
}

.auth-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    z-index: 1000;
}

.language-selector-auth {
    position: relative;
}

.lang-btn-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--auth-box-bg);
    border: 2px solid var(--auth-border);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    color: var(--auth-text);
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.lang-btn-auth:hover {
    background: var(--auth-input-bg);
    border-color: #3390ec;
}

.lang-flag-auth {
    display: flex;
    align-items: center;
    width: 20px;
    height: 15px;
}

.lang-flag-auth svg {
    width: 100%;
    height: 100%;
    display: block;
}

.lang-code-auth {
    font-weight: 500;
}

.lang-dropdown-auth {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--auth-box-bg);
    border: 2px solid var(--auth-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1001;
}

.language-selector-auth.active .lang-dropdown-auth {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-note-auth {
    padding: 10px 15px;
    font-size: 12px;
    color: var(--auth-text);
    border-bottom: 1px solid var(--auth-border);
    text-align: center;
    opacity: 0.7;
}

.lang-option-auth {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.lang-option-auth:hover {
    background-color: var(--auth-input-bg);
}

.lang-option-auth.active {
    background-color: var(--auth-input-bg);
    color: #3390ec;
}

.lang-option-auth .lang-flag-auth {
    width: 24px;
    height: 18px;
    flex-shrink: 0;
}

.lang-name-auth {
    font-weight: 500;
}

.theme-toggle-auth {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--auth-border);
    background: var(--auth-box-bg);
    color: var(--auth-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.theme-toggle-auth:hover {
    background: #3390ec;
    color: white;
    border-color: #3390ec;
    transform: scale(1.05);
}

.theme-toggle-auth svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 480px) {
    .auth-box {
        padding: 30px 20px;
    }

    .auth-header h1 {
        font-size: 28px;
    }

    .auth-form h2 {
        font-size: 20px;
    }

    #seedWords {
        grid-template-columns: repeat(2, 1fr);
    }

    .seed-actions {
        flex-direction: column;
    }
    
    .auth-controls {
        top: 10px;
        right: 10px;
        flex-direction: column;
    }
    
    .lang-dropdown-auth {
        right: auto;
        left: 0;
    }
}

/* QR Code tabs */
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--auth-border);
}
.auth-tab {
    flex: 1; padding: 10px;
    background: none; border: none;
    font-family: inherit; font-size: 14px; font-weight: 500;
    color: var(--text-secondary, #707579);
    cursor: pointer; transition: all 0.15s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.auth-tab.active {
    color: #3390ec;
    border-bottom-color: #3390ec;
}
.auth-tab:hover { color: #3390ec; }

/* Система уведомлений - оверлеи сверху */
.notification-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    align-items: center;
    width: 100%;
    max-width: 500px;
    padding: 0 20px;
}

.notification {
    min-width: 300px;
    max-width: 500px;
    width: 100%;
    padding: 18px 24px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    color: #ffffff;
    pointer-events: auto;
    cursor: pointer;
    text-align: center;
    transform: translateY(-120px) scale(0.8);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.4s;
    animation: notificationSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes notificationSlideIn {
    from {
        transform: translateY(-120px) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes notificationSlideOut {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateY(-120px) scale(0.8);
        opacity: 0;
    }
}

.notification.show {
    animation: notificationSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.notification.hide {
    animation: notificationSlideOut 0.3s ease-in forwards;
}

.notification-error {
    background: linear-gradient(135deg, #ff4757 0%, #ee5a6f 100%) !important;
    border: 2px solid #ff1744 !important;
    color: #ffffff !important;
    box-shadow: 0 8px 32px rgba(255, 71, 87, 0.4) !important;
}

.notification-success {
    background: linear-gradient(135deg, #2ed573 0%, #1e90ff 100%) !important;
    border: 2px solid #00c851 !important;
    color: #ffffff !important;
    box-shadow: 0 8px 32px rgba(46, 213, 115, 0.4) !important;
}

.notification:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
    .notification-container {
        top: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        max-width: 100%;
        padding: 0;
    }
    
    .notification {
        min-width: auto;
        max-width: 100%;
        width: 100%;
    }
}

/* Индикатор проверки username */
.username-check-status {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 500;
    min-height: 18px;
    transition: color 0.3s;
}

.username-check-status.loading {
    color: var(--auth-text);
    opacity: 0.7;
}

.username-check-status.available {
    color: #2ed573;
}

.username-check-status.taken {
    color: #ff4757;
}

