:root {
    --bg: #0a0a0a;
    --surface: #141414;
    --surface-hover: #1a1a1a;
    --border: #2a2a2a;
    --text: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
}

[data-theme="light"] {
    --bg: #f8f9fa;
    --surface: #ffffff;
    --surface-hover: #f1f3f5;
    --border: #dee2e6;
    --text: #1a1a1a;
    --text-secondary: #495057;
    --text-muted: #868e96;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.register-wrapper {
    width: 100%;
    max-width: 540px;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.register-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.brand-section {
    text-align: center;
    margin-bottom: 32px;
}

.brand-icon {
    width: 56px;
    height: 56px;
    background: var(--text);
    color: var(--bg);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -1px;
    user-select: none;
}

.brand-section h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.brand-section p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.error-alert {
    background: var(--danger-bg);
    border: 1px solid var(--danger);
    border-left: 3px solid var(--danger);
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
    animation: shake 0.5s ease-in-out;
}

.error-alert i {
    color: var(--danger);
    font-size: 16px;
    margin-top: 1px;
    flex-shrink: 0;
}

.error-alert span {
    font-size: 13px;
    color: var(--danger);
    line-height: 1.5;
}

.success-alert {
    background: var(--success-bg);
    border: 1px solid var(--success);
    border-left: 3px solid var(--success);
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
    animation: slideDown 0.5s ease-out;
}

.success-alert i {
    color: var(--success);
    font-size: 16px;
    margin-top: 1px;
    flex-shrink: 0;
}

.success-alert span {
    font-size: 13px;
    color: var(--success);
    line-height: 1.5;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group .optional {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 400;
    text-transform: none;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text);
    font-family: inherit;
    transition: all 0.2s;
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--text);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-wrapper .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
    transition: color 0.2s;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    font-size: 14px;
    transition: color 0.2s;
    line-height: 1;
}

.password-toggle:hover {
    color: var(--text-secondary);
}

.password-strength {
    margin-top: 8px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s;
    border-radius: 2px;
}

.password-requirements {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.password-requirements span {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.password-requirements span i {
    font-size: 6px;
}

.password-requirements span .fa-check-circle {
    color: var(--success);
}

.password-match {
    margin-top: 8px;
    font-size: 12px;
}

.password-match span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.register-btn {
    width: 100%;
    padding: 13px;
    background: var(--text);
    color: var(--bg);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    letter-spacing: 0.3px;
    margin-top: 8px;
}

.register-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.register-btn:active {
    transform: translateY(0);
}

.register-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.login-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
}

.login-link a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.login-link a:hover {
    color: var(--accent);
}

@media (max-width: 480px) {
    .register-card {
        padding: 28px 24px;
        border-radius: 12px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .brand-section h1 {
        font-size: 20px;
    }
    
    .brand-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
        border-radius: 12px;
    }
    
    .input-wrapper input {
        padding: 11px 14px 11px 38px;
        font-size: 13px;
    }
    
    .register-btn {
        padding: 11px;
        font-size: 13px;
    }
}

.rate-limit-locked {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
}

.rate-limit-locked .lock-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.rate-limit-locked .lock-icon i {
    font-size: 24px;
    color: #f59e0b;
}

.rate-limit-locked .locked-title {
    font-size: 16px;
    font-weight: 700;
    color: #f59e0b;
    margin-bottom: 6px;
}

.rate-limit-locked .locked-message {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.pin-info {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #ffc107;
}

.pin-info i {
    font-size: 0.9rem;
    margin-top: 1px;
}

.pin-info span {
    line-height: 1.4;
}

#pin_2fa {
    letter-spacing: normal;
    font-family: inherit;
}

#pin_2fa::placeholder {
    letter-spacing: normal;
    font-family: inherit;
}