:root {
    --bg-deep: #0d0d0d;
    --bg-dark: #1a1a1a;
    --bg-mid: #2a2a2a;
    --surface: #1e1e1e;
    --surface-2: #2c2c2c;
    --surface-3: #3a3a3a;

    --text-primary: #f0f0f0;
    --text-secondary: #b0b0b0;
    --text-muted: #777777;

    --violet-deep: #2d1454;      
    --violet-dark: #4a2a7a;
    --violet-mid: #6d3b9e;
    --violet-bright: #8b5cf6;
    --violet-glow: #a78bfa;
    --violet-light: #c4b5fd;

    --border: rgba(139, 92, 246, 0.22);
    --border-bright: rgba(139, 92, 246, 0.55);

    --error: #ef4444;
    --success: #10b981;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

.page-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(91, 45, 142, 0.20) 0%, transparent 45%),
        var(--bg-deep);
}

.card-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1180px;
    padding: 40px;
}

.card {
    display: flex;
    min-height: 680px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(139, 92, 246, 0.08);
    animation: slideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-left {
    flex: 1 1 50%;
    padding: 56px 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--surface);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--violet-mid), var(--violet-bright));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.logo-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--violet-light), var(--violet-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.heading-block {
    margin-bottom: 28px;
}

.page-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 14.5px;
    color: var(--text-secondary);
}

.tabs {
    display: flex;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 24px;
    max-width: 320px;
}

.tab-btn {
    flex: 1;
    padding: 11px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border-radius: 11px;
    cursor: pointer;
    transition: all 0.25s;
}

.tab-btn.active {
    background: #fff;
    color: var(--bg-deep);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 7px;
    letter-spacing: 0.01em;
}

.form-label i {
    width: 16px;
    color: var(--violet-glow);
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--violet-bright);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--violet-mid), var(--violet-bright));
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.btn-primary:hover::after { opacity: 1; }

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(139, 92, 246, 0.4);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.link-btn {
    background: none;
    border: none;
    color: var(--violet-glow);
    cursor: pointer;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

.link-btn:hover { color: var(--violet-light); }

.alert {
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
    align-items: center;
    gap: 8px;
}

.alert.show { display: flex; }

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.form-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.form-panel.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}

.strength-bar {
    display: flex;
    gap: 4px;
    margin-top: 7px;
}

.strength-seg {
    height: 3px;
    flex: 1;
    border-radius: 99px;
    background: var(--surface-3);
    transition: background 0.3s;
}

.strength-seg.weak { background: var(--error); }
.strength-seg.medium { background: #f59e0b; }
.strength-seg.strong { background: var(--success); }

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.card-footer-text {
    margin-top: 32px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-muted);
}

.card-right {
    flex: 1 1 50%;
    position: relative;
    background: linear-gradient(155deg, var(--violet-mid) 0%, var(--bg-dark) 55%, var(--bg-deep) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-right::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
}

.vault-image {
    position: relative;
    z-index: 1;
    max-width: 78%;
    max-height: 78%;
    object-fit: contain;
    filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.45));
}

#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: 100%;
    pointer-events: none;
}

.toast {
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-primary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    pointer-events: all;
    animation: slideInRight 0.3s ease;
    backdrop-filter: blur(8px);
}

.toast-success { border-color: var(--success); }
.toast-error { border-color: var(--error); }
.toast-info { border-color: var(--violet-bright); }

.toast-icon { font-size: 20px; flex-shrink: 0; }
.toast-message { flex: 1; line-height: 1.4; }
.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 980px) {
    .card-right { display: none; }
    .card-wrap { padding: 20px; }
    .card-left { padding: 44px 32px; }
}

@media (max-width: 480px) {
    .card-left { padding: 36px 22px; }
    .page-title { font-size: 28px; }
    .tabs { max-width: 100%; }
}